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.
Razorsettings.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); };
Files to Look At
More Examples
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)