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

Usage of telerik:GridViewSelectColumn

5 Answers 381 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Munish
Top achievements
Rank 1
Munish asked on 11 Feb 2014, 01:53 PM
Hi

I have added one column as <telerik:GridViewSelectColumn/> so that the user will have the option to select/unselect all the rows at a time. Now I want to access the rows which user has marked as checked on this column.

<telerik:RadGridView     SelectionMode="Extended"         ItemsSource="{Binding FilterDataGridRows}"     SelectedItem="{Binding SelectedData,Mode=TwoWay}"

Doing something like this...but this is not working...

It is suggested on this side to use some dependency property to get the SelectedItems.....

Is there any easy way to achieve the selected rows ??

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 11 Feb 2014, 05:40 PM
Hello,

May I ask you to clarify whether you would like to access the data items bound to the rows being selected or the GridViewRows themselves?

Regards,
Didie
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Munish
Top achievements
Rank 1
answered on 12 Feb 2014, 06:16 AM
Hi Didie

Yes , I want to access the dataitems bound to the rows which are marked as selected. 
0
Dimitrina
Telerik team
answered on 12 Feb 2014, 08:45 AM
Hello,

Thank you for clarifying.
You can check this github example on how to bind the SelectedItems to a collection from your view model. Although GitHub is a very well-known platform we saw a better and easier approach for reviewing our examples developing our brand new SDK Samples Browser. You can also use it to review the examples.

Regards,
Didie
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Peter
Top achievements
Rank 1
answered on 08 Dec 2016, 03:37 PM

Hello,

Picking up on this thread since I have kind of the same problem.

I looked at the example, which was very good, but the difference in my case is that instead of having all the xaml-code in 1 MainWindow, I have 2 User Controls put in the MainWindow. Using the example you supplied, that would mean that the RadGridView would be in the first UserControl, and the ListView would be in the second one.

If we look at my case, in both of my user controls I have a RadGridView in each, and when I select a row in the first one, the second one should get the id from the selected row in the first one, and use that for a database call to get the data that should be displayed in the second UserControl/RadGridView.

I tried to use your example with a SelectedItemsBindingBehavior class, but I just can't get it to work.

Any help is appreciated.

Thanks,

Peter Centellini

0
Dilyan Traykov
Telerik team
answered on 12 Dec 2016, 01:56 PM
Hello Peter,

If I understood your requirements correctly, I do not believe that using this implementation of the SelectedItemsBindingBehavior will be sufficient in this case.

What you could do, however, is to handle the first RadGridView's SelectionChanged event and use the SelectionChangeEventArgs' AddedItems and RemovedItems to set the second RadGridView's DataContext and/or ItemsSource respectively.

Please let me know whether such an approach would work for you.

Regards,
Dilyan Traykov
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Tags
GridView
Asked by
Munish
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Munish
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or