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

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?

噜噜哒
浏览 86回答 2
2回答

收到一只叮咚

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

紫衣仙女

XtraGrid 中的 rowHandle一般是通过鼠标在Grid上的位置计算出来的。计算方法如下:using&nbsp;DevExpress.XtraEditors;using&nbsp;DevExpress.Utils;using&nbsp;DevExpress.XtraGrid.Columns;using&nbsp;DevExpress.XtraGrid.Views.Grid;using&nbsp;DevExpress.XtraGrid.Views.Grid.ViewInfo;&nbsp;//以在Grid上按下鼠标为例private&nbsp;void&nbsp;gridView_MouseDown(object&nbsp;sender,&nbsp;MouseEventArgs&nbsp;e)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//利用&nbsp;CalcHitInfo(&nbsp;)&nbsp;计算鼠标位置信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GridHitInfo&nbsp;hit&nbsp;=&nbsp;gridView.CalcHitInfo(e.Location);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//判断鼠标所在位置是否在表格单元中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(hit.HitTest&nbsp;!=&nbsp;GridHitTest.RowCell&nbsp;||&nbsp;hit.RowHandle&nbsp;<&nbsp;0)&nbsp;return;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//注意这句:利用&nbsp;hit.RowHandle,取出Grid中的内容&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;deviceId&nbsp;=&nbsp;(string)gridView.GetRowCellValue(hit.RowHandle,&nbsp;"DeviceId");}
打开App,查看更多内容
随时随地看视频慕课网APP