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貢獻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" ); } |
- 2 回答
- 0 關注
- 126 瀏覽
添加回答
舉報
0/150
提交
取消