dev gridview表格按钮,按行设置名称
设置表格CustomDrawCell事件,在表格事件里处理
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e.Column.Name == "gcoperation")//操作 { var row = gridView1.GetRow(e.RowHandle) as SystemConfigModel; if (row != null) { var but = (DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit)e.Column.ColumnEdit; if (row.disabled.ToString() == "禁用") { but.Buttons[1].Caption = "启用"; } else { but.Buttons[1].Caption = "禁用"; } } } }