DevExpress实现GridControl根据列选中一行
作者:shichen2014 时间:2021-08-16 05:23:19
本文实例形式展示了DevExpress实现GridControl根据列选中一行的方法,比较实用的功能,希望能对大家进行项目开发起到一定的借鉴与帮助作用。具体方法如下:
主要功能代码如下:
/// <summary>
/// 根据列来选中一行
/// </summary>
/// <param name="gridView">GridView</param>
/// <param name="colName">列名称</param>
/// <param name="colValue">列值</param>
public static void SelectRow(this GridView gridView, string colName, object colValue)
{
gridView.ClearSelection();
for (int rowHandle = 0; rowHandle < gridView.RowCount; rowHandle++)
{
object _cellValue = gridView.GetRowCellValue(rowHandle, colName);
if (_cellValue != null)
{
if (_cellValue == colValue)
{
gridView.SelectRow(rowHandle);
break;
}
}
}
}
代码示例如下:
gcLampConfig.UIThread<GridControl>(gc => gvLampConfig.SelectRow(gcKeyFieldName, _finded.LampID));
标签:DevExpress
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java并发编程预防死锁过程详解
2023-11-09 15:33:58
Struts2下拉框实例解析
2021-09-16 16:29:59
![](https://img.aspxhome.com/file/2023/9/61399_0s.jpg)
SpringBoot 二维码生成base64并上传OSS的实现示例
2023-05-12 04:41:33
springboot2.x整合tkmapper的示例代码
2021-09-19 11:56:59
浅谈JVM垃圾回收之哪些对象可以被回收
2021-08-14 18:57:47
![](https://img.aspxhome.com/file/2023/5/61385_0s.png)
Spring Boot 项目发布到 Tomcat 服务器的操作步骤
2023-10-28 09:39:05
Jackson多态序列化图文详解
2022-01-26 19:46:08
![](https://img.aspxhome.com/file/2023/1/69891_0s.jpg)
response文件流输出文件名中文不显示的解决
2023-02-06 19:41:02
Java中后台线程实例解析
2022-01-05 06:45:08
详解JAVA流程控制语句
2023-11-05 02:27:09
![](https://img.aspxhome.com/file/2023/1/58711_0s.png)
在Maven下代理服务器设定的方式
2023-10-15 02:17:13
![](https://img.aspxhome.com/file/2023/9/58569_0s.png)
Java实现单链表基础操作
2021-08-07 13:46:04
![](https://img.aspxhome.com/file/2023/8/70998_0s.jpg)
基于javaMybatis存进时间戳的问题
2023-11-29 02:55:51
Java面试题-实现复杂链表的复制代码分享
2023-11-23 20:05:39
Java 数据结构深入理解ArrayList与顺序表
2023-02-15 14:24:07
![](https://img.aspxhome.com/file/2023/1/62501_0s.png)
SpringBoot整合之SpringBoot整合MongoDB的详细步骤
2023-11-25 09:55:37
![](https://img.aspxhome.com/file/2023/6/59076_0s.png)
Java实现TopK问题的方法
2023-11-10 20:32:14
Java-String类最全汇总(下篇)
2023-11-09 14:45:26
![](https://img.aspxhome.com/file/2023/7/58857_0s.jpg)
c# 调用Surfer软件,添加引用的具体操作方法
2023-12-06 17:05:37
![](https://img.aspxhome.com/file/2023/6/68656_0s.png)
SpringBoot整合第三方技术的详细步骤
2023-11-29 08:22:48
![](https://img.aspxhome.com/file/2023/7/60777_0s.png)