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

ChangeCells - combining multiple styles

Hello, I would like to be able to use the ChangeCells method of the grid to iteratively build my final style for my cells. For instance, I have commonly defined cell styles such as currency, percent, etc. but I might also want to have other seperate GridStyleInfo style objects for other properties, such as background color or border color. I can't seem to figure out how to get the ChangeCells method to iteratively build my final cell. Thanks! (hoping we can get approval for our order for the suite with the source code to go through so I can really get a handle on how things work!)

2 Replies

AD Administrator Syncfusion Team July 30, 2003 12:59 PM

Here is some code. I am not sure if this is what you had in mind or not. GridStyleInfo boldRedFont = new GridStyleInfo(); boldRedFont.Font.Bold = true; boldRedFont.TextColor = Color.Red; GridStyleInfo blueCell = new GridStyleInfo(); blueCell.BackColor = Color.DodgerBlue; blueCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Blue, GridBorderWeight.Thin); blueCell.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, Color.Blue, GridBorderWeight.Thin); this.gridControl1.ChangeCells(GridRangeInfo.Cells(2,2,4,4), blueCell, Syncfusion.Styles.StyleModifyType.Override); this.gridControl1.ChangeCells(GridRangeInfo.Cells(2,2,4,4), boldRedFont, Syncfusion.Styles.StyleModifyType.Override);


PL Paul Laudeman July 31, 2003 05:28 AM

That's it, I just wasn't clear on the StyleModifyType options. Thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon