Jump to content
Software FX Community

Error when removing fields from the data view


Recommended Posts

I'm using build 3554, and I'm having a problem removing fields from the data view. If I call, for instance, chtTest.DataView.Fields.Items.RemoveAt(0) in the DataBound event of the chart after calling chtTest.DataView.Fields.ReloadFieldsFromData(), the data view stops working and I get the following error written to output:

 System.Windows.Data Error: 16 : Cannot get 'Data' value (type 'IEnumerable') from '' (type 'ItemsSourceHolder'). BindingExpression:Path=Data; DataItem='ItemsSourceHolder' (HashCode=10261382); target element is 'DataGridItems' (Name=''); target property is 'ItemsSource' (type 'IEnumerable') TargetInvocationException:'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.

at ChartFX.WPF.Internal.AttributesResolver.a(Int32 A_0)

at ChartFX.WPF.DataGridItems.RenderHeaders(PaintInfo paintInfo)

at ChartFX.WPF.DataGridItems.BuildItemsSource(Object obj, IEnumerator enumerator, Int32 count, Int32& rows)

at ChartFX.WPF.DataView.ChartFX.WPF.Internal.ILogicalItemsBuilder.Build()

at ChartFX.WPF.Internal.ItemsSourceHolder.get_Data()

--- End of inner exception stack trace ---

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)

at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level)

at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'

I've attached an application that reproduces this issue. To replicate, click "Reload Data", then "Hide Series", then "Reload Data" again.

Thank you.

Link to comment
Share on other sites

We have a very similar effect and get the same exception:

 Index was outside the bounds of the array.

at ChartFX.WPF.Internal.AttributesResolver.b(Int32 A_0, Int32 A_1)

at ChartFX.WPF.Axis.ChartFX.WPF.Internal.ILegendItemGenerator.BuildNext(LogicalItemCollection items, Chart chart, Int32& index, LegendItemAttributesResolved resolved, ResolvedAttributes attributes, Object target, Object& extraData)

at ChartFX.WPF.LegendBox.a(ILegendItemGenerator A_0, LogicalItemCollection A_1, LegendItemAttributesResolved A_2)

at ChartFX.WPF.LegendBox.a()

at ChartFX.WPF.LegendBox.OnMeasure()

at ChartFX.WPF.BorderContent.MeasureOverride(Size availableSize)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

at System.Windows.UIElement.Measure(Size availableSize)

at ChartFX.WPF.Controls.SpacingDockPanel.MeasureOverride(Size availableSize)

at System.Windows.FrameworkElement.MeasureCore(Size availableSize)


See the attached application which reproduces the problem.

Do the following:

- Click "Add Point"

- Select Tab2

- Click "Add Point"

- Select Tab1

- Click "Add Point"

 In additon, the application shows a few more unexpected effects:

- Charts are not updated, when in an unselected tab and show stale data when they reapear in the selected tab

- Legends of pie charts disapear when data changes (Therefore, the collapsed/visible statements)


Regards and thanks



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...