GridBoundColumns designer without grid

Hi I have created a component with members datasource,datamember and a GridBoundColumnsCollection. I can create a gridboundcolumnscollection in design without a GDBG. The only problem I have is that the GridStyleInfo isn''t fully created when I add a new gridboundcolumn to the collection - every property from the GridStyleInfo is Nothing( Object reference not set to an instance of an object.) How can I add a GridStyleInfo to a gridboundcolumn without using a GDBG ?

1 Reply

AD Administrator Syncfusion Team February 17, 2006 07:29 PM UTC

Hi Krijn, not 100% sure if that will help but I looked through the code and I added some code so that it will check whether a grid model is attached to the bound column. If you have source code you can replace this class in GridBoundColumn.cs internal class GridBoundColumnStyleInfoIdentity: StyleInfoIdentityBase { GridBoundColumn boundColumn; protected IStyleInfo[] savedBaseStyles = null; // Cache public GridBoundColumnStyleInfoIdentity(GridBoundColumn col) { this.boundColumn = col; } public override void Dispose() { savedBaseStyles = null; boundColumn = null; base.Dispose(); } /// public override IStyleInfo[] GetBaseStyles(IStyleInfo thisStyleInfo) { if (savedBaseStyles == null && this.boundColumn != null) { int level; GridStyleInfo style = thisStyleInfo as GridStyleInfo; string baseStyleName = style.HasBaseStyle ? style.BaseStyle : ""; if (boundColumn.Owner == null || boundColumn.Owner.gridModel == null) { savedBaseStyles = new GridStyleInfo[0]; } else { GridStyleInfo[] infoMapStyles = boundColumn.Owner.gridModel.BaseStylesMap.GetBaseStylesMapStyles(baseStyleName, out level); savedBaseStyles = new GridStyleInfo[level]; if (infoMapStyles != null) Array.Copy(infoMapStyles, 0, savedBaseStyles, 0, level); } } return savedBaseStyles; } /// public override void OnStyleChanged(StyleInfoBase style, StyleInfoProperty sip) { savedBaseStyles = null; } } Stefan

Loader.
Up arrow icon