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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

BaseStyle use in QueryCellInfo event

Thread ID:

Created:

Updated:

Platform:

Replies:

6048 Jul 29,2003 07:14 PM UTC Jul 30,2003 06:02 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 29, 2003 07:14 PM UTC

I have created some extra BaseStyles that I want to use formatting specific cells in QueryCellInfo event. .... e.Style.BaseStyle = "CustomBaseStyle1"; .... Some of the custom BaseStyles I'm creating don't have ANY effect on the cell styles. For example "CustomBaseStyle1" has the following definition when it's created: customBaseStyle1.ReadOnly = true; customBaseStyle1.BackColor = Color.LightGray; customBaseStyle1.TextColor = Color.LightGray; GridBaseStyle newBaseStyle = new GridBaseStyle("CustomBaseStyle1", false, disabledCellStyleInfo); gridDataBound.BaseStylesMap.AddRange(new GridBaseStyle[1] {newBaseStyle}); Question: ----------------- Why the ReadOnly property doesn't have any impact when I change the BaseStyle in a cell to the CustomBaseStyle1? Should I change the style using ChangeCells(GridRangeInfo.Cells(1, 1, 2, 2), style, StyleModifyType.Override) ?

Administrator [Syncfusion]
Replied On July 30, 2003 02:44 AM UTC

It should work fine. We made a fix regarding read-only settings after 1.6.1.0. You should check it with our latest private patch and let us know if the problem still exists. However, please do also note that if the cell has any explicit settings, these will always have higher precedence than the base style settings. For example, if you explicitly have set the BackColor for a cell the cells back color will be used and not the one of the base style. Also, in your sample code above please note that you initialize "customBaseStyle1" but then you assign "disabledCellStyleInfo" to the base style (but I guess that's just a problem with the snippet you created to describe your situation and you use the right objects in your program ...) Stefan

Administrator [Syncfusion]
Replied On July 30, 2003 05:43 PM UTC

> > It should work fine. We made a fix regarding read-only settings after 1.6.1.0. You should check it with our latest private patch and let us know if the problem still exists. > > However, please do also note that if the cell has any explicit settings, these will always have higher precedence than the base style settings. For example, if you explicitly have set the BackColor for a cell the cells back color will be used and not the one of the base style. > > Also, in your sample code above please note that you initialize "customBaseStyle1" but then you assign "disabledCellStyleInfo" to the base style (but I guess that's just a problem with the snippet you created to describe your situation and you use the right objects in your program ...) > > Stefan I'm going to test using 1.6.5 and let you know the results. About setting the baseStyle to a cell, what do I have to do to override the cell style "completely" with the new basestyle? What style settings are considered explicit? Regards, Jose

Administrator [Syncfusion]
Replied On July 30, 2003 06:02 PM UTC

You would have to reset these properties then in the specific style, e.g. style.ResetInterior. Then the style will inherit interior from a base style. If you want to force style settings onto a style object, then you could call style.ModifyStyle(baseStyle, ModifyStyle.Override); this will copy over settings from baseStyle into the style object. Stefan

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.

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

;