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.

Updating column appearance

Thread ID:

Created:

Updated:

Platform:

Replies:

50825 Oct 19,2006 02:48 PM Oct 23,2006 04:07 PM Windows Forms 3
loading
Tags: GridControl
ecastill
Asked On October 19, 2006 02:48 PM

I have created a DateTimeCellAppearance class which is a subclass GridTableCellAppearance. I set the Appearance property of one of my GridColumnDesriptor objects to be an instance of this DateTimeCellAppearance object.

Within the DateTimeCellAppearance class, I'm changing the AnyrecordFieldCell.Format property every so often to vary from "MM/dd/yyyy" to "dd/MM/yyyy". I would like for these changes to be reflected in my grid, but for some reason, they are not reflected.

Any suggestions on how I can get this to work?

Thanks!

ecastill

Jayakumar Natarajan [Syncfusion]
Replied On October 20, 2006 06:58 PM

Hi Ecastill,
I am not sure whether it would work. We are trying to setup a sample to see the behavior here. If you could send us your sample, it would be helpful.

Thanks,
Jay

ecastill
Replied On October 22, 2006 02:59 PM

Attached is an example. Modifying the appearance internally doesn't seem to work, but re-assigning the appearance of the column seems to work.

Modifying the appearance internally then notifying the parent grid of change would be ideal. I've tried calling Owner.RaiseAppearanceChanged from inside my custom appearance, but this doesn't work. Any suggestions?

Thanks,

Eric

GridColumnAppearanceTest.zip

Jayakumar Natarajan [Syncfusion]
Replied On October 23, 2006 04:07 PM

Hi Eric,
It is not possible to assign an instance of a Appearance object to a column descriptor or any other engine object. When you call the Appearance setter it will just copy the values from the object.

This is the Appearance getter/setter for reference:


public GridTableCellAppearance Appearance
{
get
{
if (appearance == null)
{
appearance = new GridTableCellAppearance(this);
appearance.PropertyFilter = GridTableCellAppearance.ColumnDescriptorPropertyFilter;
}
return appearance;
}
set
{
if (value != null)
Appearance.InitializeFrom(value);
else
ResetAppearance();
}
}


Therefore modifying your appearance object internally will have no effect on the columns that is was previously assigned to. Every time you make a change to your appearance object you will have to reapply them to the columns you applied it.

You could try to define a base style instead and register it with GridGroupingControl.BaseStyles. Then your column can specify that “basestyle” to inherit settings from and changes made to the base style will be reflected in the columns.

This is description of GridGroupingControl.BaseStyles



///

/// Maintains a collection of base styles. Users can add BaseStyles to the engine (also in design-time) and

/// then inherit style settings through the GridStyleInfo.BaseStyle property in

/// property of .

///


public GridTableBaseStyleCollection BaseStyles


Thanks,
Jay

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.

;