When the AutoGenerateColumns property is set to true
, handle the GridViewSettings.DataBound event to add a column to the Grid View. Before adding the column, check whether a column already exists to avoid duplicate columns.
settings.DataBound = (sender, e) => {
MVCxGridView grid = sender as MVCxGridView;
if (grid.Columns.IndexOf(grid.Columns["CommandColumn"]) != -1)
return;
GridViewCommandColumn col = new GridViewCommandColumn();
col.Name = "CommandColumn";
col.ShowSelectCheckbox = true;
col.VisibleIndex = 0;
grid.Columns.Add(col);
};
(you will be redirected to DevExpress.com to submit your response)