我想在GridViewControl中添加新行。我嘗試了下面的代碼。但它不會添加任何行。如何在Winforms中使用C#代碼在DevExpress Gridview中添加新行?
我創建了列FilterValues
使用RunDesigner。
然後我試圖通過下面的代碼
(gridControlMultiFilterValues.MainView as DevExpress.XtraGrid.Views.Grid.GridView).AddNewRow();
int newRowHandle = (gridControlMultiFilterValues.MainView as DevExpress.XtraGrid.Views.Grid.GridView).FocusedRowHandle;
(gridControlMultiFilterValues.MainView as DevExpress.XtraGrid.Views.Grid.GridView).SetRowCellValue(newRowHandle, fieldName: "FilterValues", _value: "3rd Party %");
(gridControlMultiFilterValues.MainView as DevExpress.XtraGrid.Views.Grid.GridView).UpdateCurrentRow();
(gridControlMultiFilterValues.MainView as DevExpress.XtraGrid.Views.Grid.GridView).RefreshData();
是gridControlMultiFilterValues綁定做任何數據源? –