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
485
Assigning different CSS Classes for Even and Odd Rows
posted

Hi Team,

I have used following code in InitializeRow even to apply different CSS for event and Odd Row -

if(e.Row.Index % 2 == 0)

e.Row.Style.CssClass = "clsTREven";

else

e.Row.Style.CssClass = "clsTROdd";

The above code does not display desired output. It display accurate result for top 10 rows but after it display same style for consecutive 2-3 rows.

Also, after applying Server side Filtering it displays rows with no style.

Note : This feature correctly work with Grid1.DisplayLayout.RowStyleDefault.CssClass and Grid1.DisplayLayout.RowAlternateStyle.CssClass but I require it in InitializeRow event.

Any Idea ?

Thanks