hello:
i am trying to host a custom control in a xamdatagrid editor using the hostanyobject solution provided by infragistics blogs. All works fine in a normal edit solution using the following binding
SelectedItem="{Binding DataRecord.DataItem.PlatformProjectPayrollClass,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:DataRecordPresenter}},Mode=TwoWay"
However when I try and use the same binding in an add row the binding never persists. Im assuming this is because the DataRecord has not been updated until it is in the list. How would I go about having something like a list in the addrow, and have it persist the list selected value down?
Hello,
I apologize that this post was not answered sooner. We are making the effort to ensure all posts are addressed by an Infragistics expert. I was wondering if you still need our assistance in this matter. If so, would you clarify further what you are tring to accomplish. It sounds like you are hosting a standard WPF ListBox (perhaps the custom control you mentioned) inside a XamDataGrid Field?
Thank you,
I'm having this very same issue.
I have a XamDatGrid, ALL the cells are hosting custom editors. For EDITTING purposes, everything "almost" works. The data is getting populated into the control from the underlying custom business object. However, changes in the custom editor controls are not getting bound back to the underlying business object. So I've had to hook into the custom editors value changed events to detect data entry changes to move that change into the underlying business object.
Now when ADDing records, it's worse. Since all of the cells are custom editors, NONE of the grids events are firing like CellChanged,EnterEditMode,RecordAdding,RecordAdded,RecordUpdated, etc.
So when my custom editor value changes event fires, while the ActiveCell will have it's record property populated, the grid's record property colllection is still empty, and the underlying business object has NOT yet been created. And even worse, properties are read only so I don't see any way to add the record object myself or instantiate and set the new business object.
I even tried sending commands to go into edit mode, accept changes, go back into edit mode, etc, but none of the events fire and no internal XamDataGrid logic seems to be firing.
1) If I just add my "new" empty business object to an observable collection, how can I get the grid to indicate that any given object row is an ADD row?
2) How can I programmatically force the grid into add mode that creates the underlying datarecord and business object BEFORE the user had even made the first change?
It seems that normally, the grid, when displaying an add row, doesn't create the underlying objects until the user changes a value in at least one cell. But now that I'm using custom editors, that logic never fires.