Hello Scott,
A possible way to go about this is to apply the
CellStyleSelector to the columns in code behind by using the
AutoGeneratingColumn event. It occurs each time new column is auto generated by the
GridView control and thepassed event arguments are of type
GridViewAutoGeneratingColumnEventArgs.
Lets say you have the
ItemsSource property of
RadGridView bound to a
DataTable and have defined the style selector as a resource in the
GridView Resource collection like so:
Then you can apply the
StyleSelector to every column or to just some of them, based on some condition as follows:
Please keep in mind that you will need to handle the condition in your custom
StyleSelector class:
I hope this helps.
Regards,
Boris
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.