Hello All,
How do I apply style for Row[i].CellStyle at runtime. I want to apply style to each cell of row at once.Right now I am using foreach loop to apply style for each cell..foreach (Cell cell in igGrid.Rows[i].Cells){ cell.Style = app.dictionary["IGStyle"] as Style;}But I dont want to use loop as there are many columns in Grid.I used this igGrid.Rows[RowIndex].CellStyle = app.dictionary["IGTestStyle"] as Style;but it is not working.In both case style is same<Style x:Key="IGTestStyle" TargetType="igGrid:CellControl"><Setter Property="FontSize" Value="11"></Setter><Setter Property="Padding" Value="0,0,0,0"/><Setter Property="Background" Value="Red"></Setter></Style>
How do I achieve this?Is anything that I missed while defining style (Target type etc..)Please send sample code.Thank you :)
-Nandu
Hi,
You can do the following to avoid a loop:
Hello,
Thanks for your reply but I am not getting required output. Row.CellStyle is not working, dont know why.. :(Is Target type in correct that I have given while defining style?
The TargetType should be CellControl.
If you set the Style of an individual cell somewhere else though, it beats out the Row's CellStyle property.
Perhaps that's the problem?
The order of priority is as Follows, from highest to lowest:
Cell.Style
Row.CellStyle
Column.CellStyle
ColumnLayout.CellStyle
XamWebGrid.CellStyle
-SteveZ