GridView总结:
获取任何一级别中GridView所选中的数据行.
1
2
GridView gView = gridControl.FocusedView as GridView;//選中的GridView
int[] rows = gView.GetSelectedRows(); //選中的行
有時需要根據條件設置某一個單元格未只讀:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private void gridView9_ShowingEditor(object sender, CancelEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView gv = gridControl1.FocusedView as DevExpress.XtraGrid.Views.Grid.GridView;
if (gv.FocusedColumn== gridColumn1)
{
MyList myList = gv.DataSource as MyList;
if (myList == null)
return;
My my = myList[gv.FocusedRowHandle] as My;
if (my == null)
return;
if(true)//條件
e.Cancel = true;
}
}
阅读(822) | 评论(0) | 转发(0) |