Hello,
I am using the MVVM pattern. I have a GridView on a usercontrol that has the datacontext set to a viewmodel. The viewmodel contains an ObservableCollection of model objects that are bound to the ItemsSource of the GridView. My GridViewDataColumn.Header properties are bound to some properties in the viewmodel and everything works as expected. The Header values are genrated dynamically and dispalyed properly through the binding. When I add a DataMemberBinding to a GridViewDataColumn and bind it to a property from the object collection, I get unexpected Header value. The Header will display the value "SourceName". This only happens when the SourceName property exists on the model object and a successful binding is created for the DataMemberBinding property. If I put in a value such as SourceNameTest, the Header is displayed correctly. Here is a snippet of one of the columns in question. As you can see it is a very simple column definition. Could you please help me understand if there is way to accomplish what I am trying to do.
I am using the MVVM pattern. I have a GridView on a usercontrol that has the datacontext set to a viewmodel. The viewmodel contains an ObservableCollection of model objects that are bound to the ItemsSource of the GridView. My GridViewDataColumn.Header properties are bound to some properties in the viewmodel and everything works as expected. The Header values are genrated dynamically and dispalyed properly through the binding. When I add a DataMemberBinding to a GridViewDataColumn and bind it to a property from the object collection, I get unexpected Header value. The Header will display the value "SourceName". This only happens when the SourceName property exists on the model object and a successful binding is created for the DataMemberBinding property. If I put in a value such as SourceNameTest, the Header is displayed correctly. Here is a snippet of one of the columns in question. As you can see it is a very simple column definition. Could you please help me understand if there is way to accomplish what I am trying to do.
<telerik:GridViewDataColumn DataMemberBinding="{Binding SourceName}" Header="{Binding SourceObjectHeader}" >
Thanks,
Jason