I am trying to delete a row when the list is a grouping set. I noticed the RemoveAt() works completely fine for when its not group, but when the list is grouped with a Key, it cannot delete in the view. My list is changing, but the view doesn't reflect the changes.
I used the Clear grouping then grouped it again, but this isn't the feature I wanted as it collapses all the opened groups prior.
private void sfButton1_Click(object sender, EventArgs e)
{
var workloadObj = sfDataGrid1.View.AddNew() as WorkloadGrid;
workloadObj.Project = "HIHI";
workloadObj.number1 = 1;
workloadGridViewList.Add(workloadObj);
sfDataGrid1.View.CommitNew();
}
private void Form1_Load(object snder, EventArgs e)
{
for (var i = 0; i < 5; i++)
{
WorkloadGrid workloadObji = new WorkloadGrid();
workloadObji.Project = i.ToString() ;
workloadObji.number1 = i;
workloadGridViewList.Add(workloadObji);
}
sfDataGrid1.DataSource = workloadGridViewList.ToList();
}
private void sfButton2_Click(object sender, EventArgs e)
{
sfDataGrid1.View.RemoveAt(0);
}
Attachment:
WindowsFormsApp1_942c86e7.rar