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
1470
IsSynchronizedWithCurrentItem & AddNew
posted

Hi there

I got a problem with the attached sample. I use the grid for some kind of a master/detail view. And for this set the property IsSynchronizedWithCurrentItem to 'true' and bind the detail controls with the "/" operator to the actual position. Everything is working as expected.

But when the AddNewRecord gets focused, the detail controls get emptied and if the user puts any value in those, this values will be lost after the grid synchronizes to an actual position.

So i made a converter, which can disable the controls, when the AddNewRow of the grid is focused. (Actually, it just return false/true, when the databound value is null--> DataBinding is not 'correct'.) I see this more as a workaround.. But, when i add an item to the bound list from code behind, the converter is not really doing what it was created for, because the detail-controls which has null in the bound properties, only getting enabled, when the user puts something in the corresponding grid cells.)

So, is there any good solution to this scenario? Or is it just impossible to have it like this?

Kind regards

Wpf_CurrentItem_Test01.zip
Parents
No Data
Reply
  • 29105
    Offline posted

    Hello,

    Thank you for contacting Infragistics. It is expected that the XamDataGrid loses it's active and selected item when you click the AddNewRecord or Filter Record. Because they are both still derive from Record base that contain the same principles of normal DataRecords. It's best to persist the record selected when you click the AddNewRecord and toggle IsSynchronizationWithCurrentItem accordingly.

    I've modified your sample, please click the record selector to the left of the cells and then click the AddNewRecord. You will see that I am keeping the current item selected in the EditModeStarting event.

    I recommend submitting a new product idea for better handling with the AddNewRecord/Filter record interaction. Let me know if you have any questions.

    Wpf_CurrentItem_Test01.zip
Children