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.
Unfortunately, activation email could not send to your email. Please try again.

Range Style

Thread ID:

Created:

Updated:

Platform:

Replies:

97126 Oct 30,2010 09:20 AM Nov 2,2010 09:54 AM Silverlight 1
loading
Tags: GridControl
Faizal Ahmd
Asked On October 30, 2010 09:20 AM

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 09:54 AM

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.

[C#]

//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.

Regards,
ponraja




GridSilverlight_197e500.zip

CONFIRMATION

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.

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.

;