Home Forums WPF controls Xceed DataGrid for WPF IsSynchronizedWithCurrentItem in XCeed Datagrid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26767 |

    In my application I have a grid listing which I wish to synchonize with other items on my page. In the ListView Control we had the option of setting the IsSynchronizedWithCurrentItem =true so that when the selection in the list view changes, other fields that are tied to the same datacontext change as well.

    How can I achieve the same through XAML and not code behind? What property would I need to set.

    Regards

    Leon Pereira

    Imported from legacy forums. Posted by Leon (had 2034 views)

    User (Old forums)
    Member
    Post count: 23064

    [Message Posted by Charles Bérubé-Rémillard]

    Hi Leon,

    You can bind on the CurrentItem or the GlobalCurrentItem (if you have Master/Detail) property. For example, assuming you are using a DataTable and that the items are System.Data.DataRow:

    e.g.,

    <TextBlock Text={Binding ElementName=myDataGridControl, Path=CurrentItem[ShipCountry]}/>

    This will display the value of the field represented by “ShipCountry”. Something like “Canada”.

    Best regards,

    Charles Bérubé-Rémillard

    Technical Support

    [Leon Pereira] 

    In my case as I was using a Collection of complex objects, instead of  DataTable

    <TextBlock Text={Binding ElementName=myDataGridControl, Path=CurrentItem.ShipCountry}/>

    worked for me.

     

    Imported from legacy forums. Posted by Leon (had 1641 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.