Conditional Row Color

5 posts, 0 answers
  1. Siddhart
    Siddhart avatar
    15 posts
    Member since:
    Apr 2013

    Posted 29 Apr 2013 Link to this post

    Hi I am using Silverlight 4.0 Telerik Radcontrols,Just came across with one logic regarding my RadGrid View.
    I wanna implement Conditional Rowcolor Formatting on base of Conditions applied on Column.

    Suppose i have 5 Columns ABCDE and I wanna make Row Green Color if Column is D is False and E is True, How we can get this solution work on condition based,Is do we need to make Color COnverter same like we do normally in silverlight 4.0 or any other strategy.

    Thanks
    Siddharth
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 29 Apr 2013 Link to this post

    Hi Sidhard,

    You can try working with StyleSeletctors as illustrated in our documentation.
    Still, please keep in mind that we have discontinued our support for Silverlight 4. 

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Siddhart
    Siddhart avatar
    15 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    Hi,

    Yes  i know i upgraded to SL 5, Have a quick question on this that cant we apply color converter instead of applying more logic??
    I am trying to place one converter and calling from xaml using rowstyle selectore, surprised it is not working.

     

     

    public class GridRowClientStatusColorConverter : IValueConverter

     

    {

     

     

    public object Convert(object value, Type targetType, object parameter,

     

     

     

    CultureInfo culture)

     

    {

     

     

    if (System.Convert.ToBoolean(value))

     

    {

     

     

    //return "#C8DAC4"; // Green Color when Client Status is "EXISTING" & Client is not Valid

     

     

     

    return "#F8B79A"; // Orange Color when Client Status is "EXISTING" & Client is not Valid

     

    }

     

     

    else

     

    {

     

     

    return parameter;

     

    }

    }

     

     

     

    public object ConvertBack(object value, Type targetType, object parameter,

     

     

     

    CultureInfo culture)

     

    {

     

     

    /* No Implementation for convert back as its one way binding */

     

     

     

    return null;

     

    }

    }

    }

  5. Siddhart
    Siddhart avatar
    15 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    Hey Telerik Team

    Could you please have me the best solution for this ??

    Thanks for the Prompt Support.

    SY
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 30 Apr 2013 Link to this post

    Hi Siddhart,

    The best possible approach is to work with RowStyleSelector as illustrated in our documentation and demos


    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner