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

GridBoundColumns designer without grid

Thread ID:





40945 Feb 17,2006 08:51 AM UTC Feb 17,2006 07:29 PM UTC WinForms 1
Tags: GridControl
Krijn Michiels
Asked On February 17, 2006 08:51 AM UTC

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 ?

Administrator [Syncfusion]
Replied On 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


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

This page will automatically be redirected to the 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