社区
C#
帖子详情
请问通过单击datagrid中某一单元格时,如何能获取单元格的所在行.
ywbair
2003-07-31 03:15:35
请问通过单击datagrid中某一单元格时,如何能获取单元格的所在行.
...全文
26
2
打赏
收藏
请问通过单击datagrid中某一单元格时,如何能获取单元格的所在行.
请问通过单击datagrid中某一单元格时,如何能获取单元格的所在行.
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
2 条
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
打赏红包
ywbair
2003-07-31
打赏
举报
回复
谢谢,问题已解决,不过是通过dataGrid自身的属性。但你提供的选中的代码也是很有用的 :)
saucer
2003-07-31
打赏
举报
回复
bookmark this Windows.Forms FAQ site:
http://www.syncfusion.com/FAQ/WinForms/default.asp
see (hti.Row is the row number):
5.7 How can I select the entire row when the user clicks on a cell in the row?
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q689q
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
if(hti.Type == DataGrid.HitTestType.Cell)
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}
相关推荐
JS
获取
单击
按钮
单元格
所在
行
的信息
主要介绍了用JS
获取
表格
中
单击
某个
单元格
中
按钮,得到所在
行
的信息,需要的朋友可以参考下
onClickCell
中
获取
点击
单元格
所在
行
的数据
onClickCell
中
获取
点击
单元格
所在
行
的数据 1、先
获取
dataGrid
中
所有
行
数据 var rows = $(’#
dataGrid
’).
datagrid
(‘getRows’); //获得所有
行
2、在从所有
行
中
根据onClickCell 点击
单元格
所在
行
数
获取
该
行
数据 var row = rows[rowIndex]; //根据rowIndex获得点击的一
行
。 实例: onClickCell: function (rowIndex, field, value) { //单元
EasyUi
DataGrid
中
数据编辑方式及编辑后数据
获取
,校验处理
EasyUi
中
的
DataGrid
提供前台编辑的相关函数。 实现客户选
中
DataGrid
中
一列后,对选
中
列
中
的一个字段进
行
编辑,并对数据进
行
实
时
校验后,传递至后台保存的需求, 主要涉及到
DataGrid
中
设置编辑
单元格
,
获取
编辑
单元格
,编辑
单元格
的onchange事件处理,通过当前光标所在编辑
单元格
获取
所在
行
。 1. 设置编辑
单元格
在列定义
中
增加editor属性,参数为
JS
获取
单元格
所在
行
用JS
获取
表格
中
单击
某个
单元格
中
按钮,得到所在
行
的信息: functionGetRowNo(){ vare=e||window.event; vartarget=e.target||e.srcElement; if(target.parentNode.tagName.toLowerCase()=="td"){
flex
datagrid
加鼠标事件
获取
行
和当前
单元格
的值
首先
datagrid
加入鼠标
单击
事件:
datagrid
.addEventListener(MouseEvent.CLICK, GetPreviewInventoryDetail); 然后在函数GetPreviewInventoryDetail里可以
获取
单击
当前
单元格
的
行
和值 private function GetPreviewInventoryDetail(evt:ListEvent
发帖
C#
C#
.NET技术 C#
复制链接
扫一扫
10.8w+
社区成员
64.2w+
社区内容
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
帖子事件
创建了帖子
2003-07-31 03:15
社区公告
让您成为最强悍的C#开发者