This question is locked. New answers and comments are not allowed.
Hi
I'm trying to programmatically assign the Axis.LabelTemplate property during run time and receive the ArgumentOutOfRangeException.
After decompiling Telerik.Windows.Controls.PresenterBase it appears that the exception is occurring when the ClearPresenters() method is called.
The line containing "this.renderSurface.Children.Remove(elements[i] as UIElement);" is attempting to access an item that was removed in the line preceding it.
internal void ClearPresenters(IList elements)
{
if (this.renderSurface == null)
{
elements.Clear();
}
else
{
for (int i = elements.Count - 1; i >= 0; i--)
{
elements.RemoveAt(i);
this.renderSurface.Children.Remove(elements[i] as UIElement);
}
this.Invalidate();
}
}
Is there another way to programmatically assign this value. I tried using a DataTemplateSelector, however, received a similar error message as it too calls the ClearPresenters method.
Thanks,
Ant
I'm trying to programmatically assign the Axis.LabelTemplate property during run time and receive the ArgumentOutOfRangeException.
After decompiling Telerik.Windows.Controls.PresenterBase it appears that the exception is occurring when the ClearPresenters() method is called.
The line containing "this.renderSurface.Children.Remove(elements[i] as UIElement);" is attempting to access an item that was removed in the line preceding it.
internal void ClearPresenters(IList elements)
{
if (this.renderSurface == null)
{
elements.Clear();
}
else
{
for (int i = elements.Count - 1; i >= 0; i--)
{
elements.RemoveAt(i);
this.renderSurface.Children.Remove(elements[i] as UIElement);
}
this.Invalidate();
}
}
Is there another way to programmatically assign this value. I tried using a DataTemplateSelector, however, received a similar error message as it too calls the ClearPresenters method.
Thanks,
Ant