Change cells style

3 posts, 0 answers
  1. Francisco
    Francisco avatar
    1 posts
    Member since:
    Jan 2013

    Posted 15 Apr 2013 Link to this post

  2. Miguel Angel Chico
    Miguel Angel Chico avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Apr 2013 Link to this post


    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.
  3. Vlad
    Vlad avatar
    11100 posts

    Posted 18 Apr 2013 Link to this post


     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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top