Hello,
I have a SfDataGrid and added an GridCheckBoxColumn.
private void LoadData()
{
dt = ConvertListToDataTable.ToDataTable(GetListLevantamentosUpdate().ToList());
data.DataSource = dt;
data.Columns.Add(new GridCheckBoxColumn()
{
MappingName = "Sel",
HeaderText = "Sel",
AllowThreeState = false,
AllowText = true,
AllowCheckBoxOnHeader = true
});
dt.Columns.Add("Sel", typeof(bool));
data.Columns["Sel"].AllowEditing = true;
}
Then, I have some operations in DataGrid, but when I Refresh it, the GridCheckBoxColumn is duplicated.
When I click in one of them, both get selected. If I refresh again, both are duplicated (now 4 Sel columns)... and so on...
How do I stop duplicating columns? Am I calling the Refresh DataGrid in the wrong way?
I'm calling LoadData() after I do my operations to Refresh DataGrid!
Thanks.