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
90
xamDataGrid How should I bind to the dataitem of selected items
posted

I have a class for managing selections in listboxes and the xam selection controls such as xamDataGrid. I am attempting to bind a selecteditems property of my class to the dataitem (a custom biz object) for the selected items in the xamDataGrid. Below is the code I am using which does not current seem to be working. WHAT is the correct way to bind to the dataitem of selected items in a xamDataGrid..

//presenter is a reference to an instance of xamDataGrid. My selection manager class is the target in this example. 

Binding selecteditemsbinding = new Binding("SelectedItems.Records/DataItem");
            selecteditemsbinding.Source = presenter;
            selecteditemsbinding.Mode = BindingMode.OneWay;

            BindingOperations.SetBinding(target, SelectedItemsProperty, selecteditemsbinding);

 Thanks!