I'm trying to bind to the color of a row in a grid.
I tried using the RowStyleSelector but it only works one time when we enter the screen.
P.S: I'm not using expression blend.
Thanks for the help,
Avi
5 Answers, 1 is accepted
May you provide a bit more details about your exact requirement? Generally the recomended approach in the newest version of our controls to change the background of a row based on a value is through StyleSelector. I suggest that I am missing something, so it could be great if you can throw some light upon your case. Thus we would be able to provide you with an appropriate solution. Any additional information about the grid version you used will be highly appreciated as well.
Vanya Pavlova
the Telerik team
The GridView is bound to a Customer colllection.
Once the user perform an operation on the selected row, we go to a WCF which basically updates a property inside Customer (the property name is: ExecutionStatus).
Once this property changes to a certain value, we want to change the background color of the selected row - the row on which the operation was performed on.
StyleSelector only works once in our case and we need a way to change it every time a row's property is changed.
Hopes this clarify it.
May you please share with us what is the type of the Customers Collection? Since INotifyPropertyChanged interface is implemented RadGridView will call the style selector on changes of the values. If it does not you may call the RadGridView.Rebind() method after the value has been changed. Please check the following demo and you will see how it works.
I am waiting to hearing from you!
Vanya Pavlova
the Telerik team
The type of the customers collection is ObservableCollection<Customer>.
Is it possible to accomplish my goal with a valueConverter.
The example you sent me wasn't that clear to me regarding my case.
May you clarify that your underlying business object implements INotifyPropertyChanged interface as it was proposed in my previous post? Once implemented any property change will be automatically reflected in GridViewRow's style.
I will be waiting for your response!
Vanya Pavlova
the Telerik team