Hi Praveen,
Here is a little sample that shows you "How to format the alternate rows in a grid using the PrepareViewStyleInfo event.
GDBGAlternateRows.zip[c#]
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if( e.RowIndex > 0 )
{
GridDataBoundGrid _grid = sender as GridDataBoundGrid;
if( ! _grid.Model.HideRows[e.RowIndex] )
{
int iVisibleRowIndex = GetPreviousVisibleRowIndex(_grid.Model,e.RowIndex );
if( iVisibleRowIndex != -1 )
{
if( _grid.GetViewStyleInfo(iVisibleRowIndex,e.ColIndex).BackColor != m_FirstColor )
e.Style.BackColor = m_FirstColor;
else
e.Style.BackColor = m_SecondColor;
}
}
}
}
Best Regards,
Haneef