This is a migrated thread and some comments may be shown as answers.

Binding to a row color

5 Answers 53 Views
GridView
This is a migrated thread and some comments may be shown as answers.
IT Support
Top achievements
Rank 1
IT Support asked on 14 Apr 2011, 01:10 PM
Hi,

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

Sort by
0
Vanya Pavlova
Telerik team
answered on 14 Apr 2011, 01:21 PM
Hello IT Support,

 

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.


Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
IT Support
Top achievements
Rank 1
answered on 14 Apr 2011, 02:11 PM
We have a type named Customer.
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.

0
Vanya Pavlova
Telerik team
answered on 14 Apr 2011, 02:38 PM
Hello IT Support,

 

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!


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
IT Support
Top achievements
Rank 1
answered on 14 Apr 2011, 03:12 PM
Hi Vanya,

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.
0
Vanya Pavlova
Telerik team
answered on 14 Apr 2011, 03:41 PM
Hi IT Support,

 

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!


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
IT Support
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
IT Support
Top achievements
Rank 1
Share this question
or