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

GridStyleInfo for entire row / col

i find myself entering this code alot: for (int i=0; i<_g.ColCount;i++) { _g[_g.RowCount,i].CellType = "Static"; _g[_g.RowCount,i].ReadOnly = true; _g[_g.RowCount,i].BorderMargins = GridMarginsInfo.Empty; _g[_g.RowCount,i].Borders.Bottom = GridBorder.Empty; _g[_g.RowCount,i].Borders.Right = GridBorder.Empty; } is there anyway to do this for the entire row (or column) without having to loop through each cell thanks, ak

2 Replies

AD Administrator Syncfusion Team July 22, 2005 12:49 PM

Is _g a GridControl? If so, you can set the styles for columns using the grid.ColStyles collection. You can set rowstyles using grid.RowStyles collection. If you want to set an arbitrary range of cells, you can use grid.ChangeCells. //red column grid.ColStyles[4].BackColor = Color.Red;


AK Adam K. July 22, 2005 12:58 PM

thks >Is _g a GridControl? > >If so, you can set the styles for columns using the grid.ColStyles collection. You can set rowstyles using grid.RowStyles collection. If you want to set an arbitrary range of cells, you can use grid.ChangeCells. > > >//red column >grid.ColStyles[4].BackColor = Color.Red; >

Loader.
Live Chat Icon For mobile
Up arrow icon