This is a migrated thread and some comments may be shown as answers.

Multiple Selection Binding

1 Answer 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JTango
Top achievements
Rank 1
JTango asked on 14 Apr 2009, 04:11 AM
I have seen the example of Binding to the SelectedRecords proerpty for the GridView. What I~27d really like to be able to do though is be able to retrieve the selected items as their underlying object type purely in XAML through a binding statement. The problem this currently has is that the SelectedRecords property is a SelectedRecordsCollection and so in the code behind I need to do something like this.~3cbr /~3e ~3cbr /~3e from record in myGrid.SelectedRecords~26nbsp~3b ~3cbr /~3e select ~28record as DataRecord~29.Data as MyObjectType~3cbr /~3e ~3cbr /~3e Is there anyway to get an IEnumerable~26lt~3bMyObjectType~26gt~3b without using code behind~3cbr /~3e ~3cbr /~3e Cheers~3cbr /~3e ~3cbr /~3e Justin

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 15 Apr 2009, 10:58 AM
Hi JTango,

What you can do is to provide a value converter to your binding statement. The converter can convert the underlying SelectedRecords collections to a collection that contains only the selected data items.
I have attached a sample project that demonstrates that approach.
Hope this works.

Regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
JTango
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or