Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Heterogeneous data in XamDataGrid with XamCalculationManager
posted

Hello,

The following article implies the DataPresenter supports heterogeneous data because it supports multiple field layouts:

http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/xamData_Hierarchical_Heterogenous_and_Free_Form_Data_Structures.html

While this is true, it doesn't seem like the XamCalculationManager supports this when using a XamDataGrid.  When using a formula that references a bound field in one of the layouts, an exception is thrown when initializing the calculation references.  There doesn't seem to be any way to get this to work, probably because it is getting a type descriptor for a known type as opposed to the type descriptor for the type of object referenced by a record with that field layout.  

For example, to support a XamDataGrid with heterogeneous records, I would assume it is possible to bind to a datasource where the Item may be some base class and after assigning a layout to a item in the datasource, only then would the bound fields be mapped to the properties of the object instance.  I am not sure how else you could support heterogeneous records.  With this assumption, I would expect that calculation references would only be determined once the layout was known. 

However this does not seem to be the case.  It appears that if the data source object type does not have the properties that are bound fields and referenced in formulas, the calculation manager will throw an exception.

Is this working as intended?  How can you possibly support heterogeneous objects and multiple layouts if the formulas in one of the layouts enforce a homogeneous data model? 

I am using build 2107 of Infragistics WPF 12.1 by the way.