DevExpress-GridView
GridView总结:
获取任何一级别中GridView所选中的数据行.
GridView gView = gridControl.FocusedView as GridView;//選中的GridViewint[] rows = gView.GetSelectedRows(); //選中的行
有時需要根據條件設置某一個單元格未只讀:
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; } }
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。