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

Conditional Row Color

4 Answers 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Siddhart
Top achievements
Rank 1
Siddhart asked on 29 Apr 2013, 06:38 PM
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

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 29 Apr 2013, 07:28 PM
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.

0
Siddhart
Top achievements
Rank 1
answered on 30 Apr 2013, 04:58 PM
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;

 

}

}

}

0
Siddhart
Top achievements
Rank 1
answered on 30 Apr 2013, 07:07 PM
Hey Telerik Team

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

Thanks for the Prompt Support.

SY
0
Maya
Telerik team
answered on 30 Apr 2013, 10:31 PM
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.

Tags
General Discussions
Asked by
Siddhart
Top achievements
Rank 1
Answers by
Maya
Telerik team
Siddhart
Top achievements
Rank 1
Share this question
or