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