I have a datagrid that displays 18 properties of an object that has 149 properties.
6/18 are always displayed for every object.
12/18 change depending on which group of the objects I want to display.
How can I change the binding of the columns I want to change at runtime programmatically.
I've tried
myBinding.Source = CutterList
myBinding.Path = New PropertyPath("ToolNumCEBF")
myBinding.Mode = BindingMode.TwoWay
myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
BindingOperations.SetBinding(dataGrid1.Columns.Item(1), TextBlock.TextProperty, myBinding)
CutterList is the original ObservableCollection of my datagrid.
myBinding.Path = New PropertyPath("ToolNumCEBF")
I think SHOULD point to a Public Property within my class that is the base of the ObservableCollection, but I'm not sure.
BindingOperations.SetBinding(dataGrid1.Columns.Item(1), TextBlock.TextProperty, myBinding)
As far as I understand is trying to set the binding of my specified column, the text to be displayed, using the other stuff I set with myBinding?
Trying to do this feel like iceskating uphill.
I've also tried just changing my DataGrid's overall itemsource without any luck, so if you have any insights there, I'm all ears.