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

Range Style

Thread ID:





97126 Oct 30,2010 01:20 PM UTC Nov 2,2010 01:54 PM UTC Silverlight 1
Tags: GridControl
Faizal Ahmd
Asked On October 30, 2010 01:20 PM UTC

Can we apply style to range of cells in the silver light grid control as like the "change info" in the windows grids?

Thanks and Regards,
Faizal Ahmed.H

Ponraja A [Syncfusion]
Replied On November 2, 2010 01:54 PM UTC

Hi Faizal,

Thank you for using Syncfusion products.
Yes, we can apply the styles to range of cells in a GridControl. Use the following code.


//define a style and set some of its properties
GridStyleInfo style = new GridStyleInfo();
style.Background = Brushes.Red;
style.Foreground = Brushes.Blue;

//have some range...
GridRangeInfo range = GridRangeInfo.Cells(3, 3, 7, 6);

//loop through the range and apply the new style to the existing styles
int rowIndex = 0, colIndex = 0;
if(range.GetFirstCell(out rowIndex, out colIndex))
grid.Model[rowIndex, colIndex].ModifyStyle(style, Syncfusion.Windows.Styles.StyleModifyType.Override);
while (range.GetNextCell(ref rowIndex, ref colIndex))
grid.Model[rowIndex, colIndex].ModifyStyle(style, Syncfusion.Windows.Styles.StyleModifyType.Override);

Please let us know if you have any query.




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