This question is locked. New answers and comments are not allowed.
Kyle Watson
Top achievements
Rank 1
Kyle Watson
asked on 03 Jan 2011, 11:53 PM
How do you change the row style based on the data bound values that exist in the current row? what is the prefferred method to accomplish this task?
5 Answers, 1 is accepted
0
Hello Kyle Watson,
Maya
the Telerik team
You may take a look at our demos and online documentation for a reference on the approach for achieving the desired result.
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Kyle Watson
Top achievements
Rank 1
answered on 04 Jan 2011, 09:37 PM
Thanks this is perfect.
0
Kyle Watson
Top achievements
Rank 1
answered on 09 Jan 2011, 11:12 PM
I have set the example up in my code and have an additional question:
I would like to set the Value of the color to an ARGB value instead of a predefefined color, what is the easieset way to accomplish this task?
I would like to set the Value of the color to an ARGB value instead of a predefefined color, what is the easieset way to accomplish this task?
0
Hello Kyle Watson,
Maya
the Telerik team
You may take a look at this and this articles for further reference on the definition of different colors.
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Kyle Watson
Top achievements
Rank 1
answered on 10 Jan 2011, 04:45 PM
Thanks. I ended up with this, thought i'd share.
Code Behind:
public sealed class GridStyle : StyleSelector { public GridStyle() { } public override Style SelectStyle(object item, DependencyObject container) { if (item is dataitem) { dataitem = item as dataitem; if (dataitem.Status == "Unread") { Style BackGroundStyle = new Style(); Style bgstyle = new Style(typeof(GridViewRow)); Setter setBackground = new Setter(GridViewRow.BackgroundProperty, new SolidColorBrush( Color.FromArgb(255,255,0,0) )); bgstyle .Setters.Add(setBackground); return bgstyle ; } } return new Style(); } }
xaml:
<UserControl.Resources> <local:GridStyle x:Key="BgGridStyle"></local:GridStyle> </UserControl.Resources> <telerik:RadGridView Name="RadGridView" RowStyleSelector="{StaticResource BgGridStyle} />