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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unexpected behavior in RowStyles indexer

Thread ID:





60857 May 14,2007 12:48 PM UTC May 14,2007 10:04 PM UTC WinForms 1
Tags: GridControl
Dave Wilkins
Asked On May 14, 2007 12:48 PM UTC


We discovered an issue with our application when setting a border for a particular row. We had an error that caused us to use an index of -1 in the grid's RowStyles property. The effect was to apply the border change to every row in the grid rather than throw an exception! Is that expected? I don't see anywhere in the docs that indicate this.


haneefm [Syncfusion]
Replied On May 14, 2007 10:04 PM UTC

Hi Dave,

For GridControl:
You can set rowstyles using grid.RowStyles collection. If you want to set an arbitrary range of cells, you can use grid.ChangeCells.

grid.RowStyles[5].Borders.All = GridBorder.Empty;

For VirtualGrid:
Please refer to the below forum thread for more details.

For DataBoundGrid.
You will have to use PrepareviewStyleInfo to do this.

Try code like this in PrepareviewStyleInfo to color the whole row.

if( e.ColIndex > 0 && e.RowIndex == 5)
e.Style.Borders.All = GridBorder.Empty;

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon