XYChart XPath/YPath: DataTable/DataView column-name paths don’t resolve like WPF bindings

Charts for WPF Forum

The latest build of this product (v25.1.2) was released 1 month ago, which was before this thread was created.
Posted 2 days ago by bcs99
Version: 25.1.2
Avatar

I’m integrating Charts for WPF (XYChart / LineSeries) into an existing WPF application that has a lot of chart “report definitions” based on DataTable column names.

In standard WPF binding, a DataTable.DefaultView (DataView) works well as an ItemsSource, because each item is a DataRowView and WPF can resolve column names as binding paths (via ICustomTypeDescriptor). For example, WPF controls can bind to Path=Time or Path=Value when the columns exist.

With Actipro XYChart series, I’m able to set ItemsSource to a DataView, but XPath="Time" / YPath="Value" results in an empty chart even though the DataView contains rows and the columns exist. This makes it seem like XPath/YPath path resolution is not using the WPF binding engine / TypeDescriptor and instead relies on reflection against CLR properties (which DataRowView doesn’t expose for columns).

Question

Is there a supported way for Actipro Charts to resolve XPath/YPath using the same semantics as WPF binding (i.e., support DataRowView column names via ICustomTypeDescriptor), or to support indexer paths like Item[Time] / Item[Value]?

This is important for scenarios where the data source is tabular and dynamic, and where we already have many report definitions based on DataTable column names. Requiring projection into CLR point types is workable, but it adds overhead and complexity for a large set of existing reports.

Any guidance or best practice would be appreciated. If this is not supported, could you confirm whether it’s by design and if there’s a recommended alternative for binding to DataTable/DataView?

Thanks,

Bob

Comments (1)

Posted 19 hours ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Bob,

We appreciate you providing all of the details for your question.  At the current time, property resolution is as you suspected based on reflection of object properties and does not consider custom type descriptors.  If you can put together a new simple sample project that shows a basic example of what you are attempting to accomplish, we would be happy to have a look to see if we can enhance things on our end to help meet your needs.  If you send a .zip to our support address, please reference this thread and remove the bin/obj folders from the .zip so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.