We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change alternating rows color

How I can change the back color in the rows?  
I mean exist the posibility of change the color in alternating rows property like in DataGridView AlternatingRowsDefaultCellStyle property
I wanna change the color.

3 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team June 21, 2014 03:53 AM UTC

Hi Mesta,

Thanks for your interest in Syncfusion Products.

If you want to change the background color , you can use BackColor property. You can change the backcolor for alternate rows by QueryCellInfo event. Please refer the below code.

 Code Snippet[C#] :

this.gridControl1.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(gridControl1_QueryCellInfo);

void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)

        {

            if (e.RowIndex % 2 == 0 && e.RowIndex!=0)

                e.Style.BackColor = Color.Red;

        }

Please let us know if you have any concern.

Regards,

Muthukumar K



IM I Mesta June 25, 2014 04:08 PM UTC

Thanks for all =)


MK Muthukumar Kalyanasundaram Syncfusion Team June 30, 2014 04:39 AM UTC

Hi Mesta,

Thank you for the update.
We are glad to hear that your issue has been resolved. Please let us know if you require any further assistance in future.

Regards,
Muthukumar K


Loader.
Up arrow icon