为了账号安全,请及时绑定邮箱和手机立即绑定

请教下第一个参数rowHandle怎么确定?

请教下第一个参数rowHandle怎么确定?

C# C
噜噜哒 2022-10-28 13:09:51
GetRowFooterCellText(int rowHandle,GridColumn)查了官网的doc,解释是An integer value specifying the group row handle. This identifies the row footer whose cell's display text is to be obtained.如果我只有一行footer,我怎么得到这个rowHandle?我试了用0,结果似乎不对。还是这个int值跟表格的其他行一起排rowHandle?
查看完整描述

2 回答

?
收到一只叮咚

TA贡献1821条经验 获得超4个赞

RowHandle 这个就是Footer的行,你想取得这个值,就必须知道Footer的RowHandle

查看完整回答
反对 回复 2022-11-01
?
紫衣仙女

TA贡献1839条经验 获得超15个赞

XtraGrid 中的 rowHandle一般是通过鼠标在Grid上的位置计算出来的。计算方法如下:


using DevExpress.XtraEditors;using DevExpress.Utils;using DevExpress.XtraGrid.Columns;using DevExpress.XtraGrid.Views.Grid;using DevExpress.XtraGrid.Views.Grid.ViewInfo; //以在Grid上按下鼠标为例private void gridView_MouseDown(object sender, MouseEventArgs e) {            //利用 CalcHitInfo( ) 计算鼠标位置信息            GridHitInfo hit = gridView.CalcHitInfo(e.Location);            //判断鼠标所在位置是否在表格单元中            if (hit.HitTest != GridHitTest.RowCell || hit.RowHandle < 0) return;            //注意这句:利用 hit.RowHandle,取出Grid中的内容            string deviceId = (string)gridView.GetRowCellValue(hit.RowHandle, "DeviceId");}


查看完整回答
反对 回复 2022-11-01
  • 2 回答
  • 0 关注
  • 83 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信