Unexpected behavior in RowStyles indexer

FYI,

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.

Thanks,

1 Reply

HA haneefm Syncfusion Team 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.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=27259
>>>>>>>>>>>>>>>>>>>>>>>>>>>>

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,
Haneef

Loader.
Up arrow icon