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

Change cells style

2 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Francisco
Top achievements
Rank 1
Francisco asked on 15 Apr 2013, 10:10 AM
-

2 Answers, 1 is accepted

Sort by
0
Miguel Angel Chico
Top achievements
Rank 1
answered on 15 Apr 2013, 10:12 AM
Hello,

I need to implement a functionality in the grid to allow the modification of a cell style (background color and tooltip) from information contained in a structure of type Dictionary <string, objects> where string is the Column.UniqueName and objet is an object that indicates the background color and tooltip message.

If I assign a class that implements IValueConverter cell style from the XAML, I get the object value with the value of the cell, but I have no access to the "object" with color and message.

If implemented in the event CellEditEnded (because the dictionary is filled after validating the value of another cell, being edited), I get retrieve rows selected cells but as a GridViewRow, and only allows access to columns currently visible. If I disable the virtualization grid, as have a large number of rows becomes impossible to use as it freezes.

What I can do? 

Thank you very much.
0
Vlad
Telerik team
answered on 18 Apr 2013, 07:15 AM
Hi,

 You can use CellStyleSelector to achieve your goal. In SelectStyle method of your selector you have access to entire data item and the style returned from the selector will work normally with grid horizontal virtualization (will be applied to the newly created cells once loaded when you scroll).

Please check your local copy of our WPF demos for more info and code!

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Francisco
Top achievements
Rank 1
Answers by
Miguel Angel Chico
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or