Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Apply Row[i].CellStyle
posted

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