GetRowFooterCellText(int rowHandle,GridColumn)查了官網(wǎng)的doc,解釋是An integer value specifying the group row handle. This identifies the row footer whose cell's display text is to be obtained.如果我只有一行footer,我怎么得到這個(gè)rowHandle?我試了用0,結(jié)果似乎不對(duì)。還是這個(gè)int值跟表格的其他行一起排rowHandle?
2 回答

收到一只叮咚
TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超5個(gè)贊
RowHandle 這個(gè)就是Footer的行,你想取得這個(gè)值,就必須知道Footer的RowHandle

紫衣仙女
TA貢獻(xiàn)1839條經(jīng)驗(yàn) 獲得超15個(gè)贊
XtraGrid 中的 rowHandle一般是通過鼠標(biāo)在Grid上的位置計(jì)算出來的。計(jì)算方法如下:
using DevExpress.XtraEditors; using DevExpress.Utils; using DevExpress.XtraGrid.Columns; using DevExpress.XtraGrid.Views.Grid; using DevExpress.XtraGrid.Views.Grid.ViewInfo; //以在Grid上按下鼠標(biāo)為例 private void gridView_MouseDown( object sender, MouseEventArgs e) { //利用 CalcHitInfo( ) 計(jì)算鼠標(biāo)位置信息 GridHitInfo hit = gridView.CalcHitInfo(e.Location); //判斷鼠標(biāo)所在位置是否在表格單元中 if (hit.HitTest != GridHitTest.RowCell || hit.RowHandle < 0) return ; //注意這句:利用 hit.RowHandle,取出Grid中的內(nèi)容 string deviceId = ( string )gridView.GetRowCellValue(hit.RowHandle, "DeviceId" ); } |
- 2 回答
- 0 關(guān)注
- 132 瀏覽
添加回答
舉報(bào)
0/150
提交
取消