We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl - GridDataTableProperties - Missing Binding To SelectedItem

Thread ID:

Created:

Updated:

Platform:

Replies:

115270 Jan 8,2014 01:22 PM UTC Feb 11,2014 11:31 AM UTC WPF 1
loading
Tags: GridControl
Patrick Crucq
Asked On January 8, 2014 01:22 PM UTC

Hi,

How can we bind the selection inside a nested grid to a property?

Kasthuriraja G [Syncfusion]
Replied On February 11, 2014 11:31 AM UTC

Hi Patrick,

Thanks for using Syncfusion products.

 We have analyzed your query. You can achieve your requirement by using ChildGridSelectedItem property. We have prepared the sample for your reference. In our sample we have the property named Selectitem in ViewModel Class and ChildGridSelectedItem is set to this property whenever the ChildGridSelectedItem changes.

Please refer the below code snippet.

Code snippet[C#]:

    this.dataGrid.Model.Table.RecordExpanded += Table_RecordExpanded;           

     void Table_RecordExpanded(object sender, GridDataValueEventArgs<GridDataRecord> e)

    {          

        e.Value.ChildModels[0].Table.RecordsSelectionChanged += Table_RecordsSelectionChanged;

    }

void Table_RecordsSelectionChanged(object sender, GridDataRecordsSelectionChangedEventArgs e)

    {

vm.Selectitem = ((sender as GridDataTable).Model as GridDataChildTableModel).ChildGridSelectedItem;

    }

 Please refer the attached sample.

 Please let us know if you have any queries.

 Thanks,

Kasthuriraja G


Attachment: Binding_selectedchild_6b4f74.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;