I am binding my RadGridView's ItemsSource to a System.Data.DataSet. This dataset is readonly and is not interpreted by my application... it's just obtained and displayed for the user to view. It comes from a web service and the idea is that this web service may change the contents being served up in the future. The number of columns in the dataset may change down the road.
There is one important exception to this. Once my application obtains the dataset from the web service, it adds a column onto it and populates it with objects of a complex type.
In my gridview, I'd like to display these objects with much more than just the default ToString.
I'd like to use a DataTemplate to do this.
I see the GridViewDataColumn's CellTemplate. But I'm not defining GridViewDataColumns in my RadGridView, because, as I mentioned, I'm binding the GridView's ItemsSource to my DataSet. So, at least at first glance, that doesn't seem useful to me.
In addition, I'm using the MVVM application model. So although I'm tempted to drop the binding to the ItemSource, manually add a GridViewDataColumn for each of my columns, and set the CellTemplate on my special column, I'm resisting the urge. Ideally I can do this all with binding.
How can I apply a DataTemplate to my cells while still binding to ItemsSource?
I wish I could specify a CellTemplateSelector for the entire GridView. Then I'd just apply a special template when the cell contained an object of my type.
Thanks for any help.
Buzz
There is one important exception to this. Once my application obtains the dataset from the web service, it adds a column onto it and populates it with objects of a complex type.
In my gridview, I'd like to display these objects with much more than just the default ToString.
I'd like to use a DataTemplate to do this.
I see the GridViewDataColumn's CellTemplate. But I'm not defining GridViewDataColumns in my RadGridView, because, as I mentioned, I'm binding the GridView's ItemsSource to my DataSet. So, at least at first glance, that doesn't seem useful to me.
In addition, I'm using the MVVM application model. So although I'm tempted to drop the binding to the ItemSource, manually add a GridViewDataColumn for each of my columns, and set the CellTemplate on my special column, I'm resisting the urge. Ideally I can do this all with binding.
How can I apply a DataTemplate to my cells while still binding to ItemsSource?
I wish I could specify a CellTemplateSelector for the entire GridView. Then I'd just apply a special template when the cell contained an object of my type.
Thanks for any help.
Buzz