Each of my records has a complex property "Child" which is a single object (not IEnumerable).
I want rows to be expandable with custom editor showing contents of "Child" property when expanded.
I have assigned ExpandableFieldRecordPresenterStyle and set IsExpandable=True on "Child" field.
According to documentation:
"If the associated Field's DataType implements the IEnumerable interface (...) Otherwise, the NestedContent will contain an ExpandedCellPresenter with the actual cell value."
Unfortunately even though expansion indicator is displayed, it does not work. When I click on it nothing is expanded and the expander just disappears completely.
HI,
Thanks for your sample, I am reviewing it.
Sincerely, Matt Developer Support Engineer
I modified your sample to handle a complex property.
Here a help .link to complex properties: http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamDataPresenter_Displaying_a_Complex_Property_XAML.html
Please review the new sample.
Sincerely,
Matt Developer Support Engineer
That's better but when you uncomment field settings, run the program and expand both rows then click second button then first row disappears (a bug I suppose ? I'm currently using v12.1).It seems to scroll up outside visible area (but no scroll bar is shown) - pressing Page-Up brings it back.
Another thing: assuming my binding path is "Child", how can I access this child object and its properties in ExpandableFieldRecordPresenter ? Based on documentation of ExpandableFieldRecord I've tried:
{Binding RelativeSource={RelativeSource TemplatedParent}, Path=NestedContent.Value}
But it evaluates to object of type CVPValueWrapper. It seems that CellValuePresenter.Value.get() is completely broken - it does not return dependency property value but a computed value - that works in code behind but not in bindings and is an absolutely wrong way of implementing DependencyProperty wrappers :(
I am attaching a new sample. I changed the path to NestedContent and added a converter. In the converter you can get access to the child object.
I replicated your issue when clicking on the 2nd button. The XamDataGrid scrolls up.
I will create a private case for this issue and email you the details.
Thanks, the issue was resolved in latest service release.
HI marcinwis,
I will have the developers look into this issue.
I will create a private case for this issue and will email you shortly with the details.
Sincerely.
No, this just binds to row object and needs explicit reference to "Child" property even though that column is already set to be bound to BindingPath="Child".
I want to bind to the value of column, like NestedContent.Value.
HI Marcinwis,
The issue with the sample was that the binding on the ContentControl in the childPresenter template needs to be bound to object that is being changed in order to receive change notifications. Previously a converter was being called to the value and since the existing binding to “NestedContent” did not raise a property changed notification, the button’s content was not re-evaluated when the name changed. To resolve this issue, the binding for the childpresenter can be changed to bind directly to the changing field: NestedContent.Record.DataItem.Child
Please see modified sample.
Matt
Developer Support Engineer
Unfortunately this solution does not react to model changes (when INotifyPropertyChanged is added to model).
Updated sample, try pressing "Change Child Instance".