Hi,
I'm creating a predetermined list of GridView's as controls in a WPF ItemsControl control, and am trying to remove rows via the ViewModel code. I am able to reference the ItemsControl binding, and when I try to delete a specified row via MyGrid.Items.Remove(knownRow), it fails (I also tried adding MyGrid.Items.Refresh() after it). I walked through the code, and found that the property MyGrid.Items.CanRemove is set to false. It's a get only property, so changing it isn't an option.
When creating the grid dynamically, I also tried setting the following properties:
grid.CanUserDeleteRows = true;
grid.IsReadOnly = false;
How do I go about removing rows from the grid?
Thanks,
Ryan
I'm creating a predetermined list of GridView's as controls in a WPF ItemsControl control, and am trying to remove rows via the ViewModel code. I am able to reference the ItemsControl binding, and when I try to delete a specified row via MyGrid.Items.Remove(knownRow), it fails (I also tried adding MyGrid.Items.Refresh() after it). I walked through the code, and found that the property MyGrid.Items.CanRemove is set to false. It's a get only property, so changing it isn't an option.
When creating the grid dynamically, I also tried setting the following properties:
grid.CanUserDeleteRows = true;
grid.IsReadOnly = false;
How do I go about removing rows from the grid?
Thanks,
Ryan