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
1890
Preselect Records
posted

I have a scenerio where I need to the selected records from one datagrid and set it in another. Both datagrids share the same datasource however I keep getting an error saying "Records must be valid records from display layout of the same dataPresenter". Any reason why?

Attached is a sample project to better explain.

 

PreSelectRecords.zip
Parents
  • 30945
    Offline posted

    Hello,

     

    Thank you for your post and the attached sample application. I have been looking into the issue that you have described and the reason for the exception that you are getting is that you are trying to add a DataRecord object from one XamDataGrid, in the SelectedItems.Records of the other XamDataGrid. In order to add a Record in the SelectedItems.Records of a XamDataGrid, the Record should be created by the same XamDataGrid. What I can suggest is looping through the collection of the Records that should be selected and using the DataItem property of those records, create a new collection of the Records of the current XamDataGrid. I have modified the sample application that you have attached, in order show how you can implement this modification.

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    DataGridControl_1.zip
Reply Children
No Data