下面的代码显示了如何利用ColumnView.InitNewRow事件初始化新创建行的PurchaseDate字段:
C#
1 using DevExpress.XtraGrid.Views.Grid; 2 private void gridView1_InitNewRow(object sender, InitNewRowEventArgs e) { 3 DevExpress.XtraGrid.Views.Grid.GridView view = sender as Grid.GridView; 4 view.SetRowCellValue(e.RowHandle, view.Columns["PurchaseDate"], DateTime.Today); 5 }
DevExpress XtraGrid网格控件示例四:初始化新建行的单元格,布布扣,bubuko.com
时间: 2024-10-11 07:32:21