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

set alternateing row style

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 10 Dec 2012, 10:28 AM
1)how can i set alternating row style in the exported document? 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Dec 2012, 10:36 AM
Hi,

Try the following code to achieve your scenario.
C#:
protected void RadGrid2_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
        GridDataItem item = e.Cell.Parent as GridDataItem;
        if (item.ItemType == GridItemType.AlternatingItem)
            item.Style["background-color"] = "Red";
        else
            item.Style["background-color"] = "Blue";
 }

Thanks,
Shinu.
Tags
Grid
Asked by
Sigma
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or