Usage of telerik:GridViewSelectColumn

6 posts, 0 answers
  1. Munish
    Munish avatar
    14 posts
    Member since:
    Apr 2013

    Posted 11 Feb 2014 Link to this post

    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 ??
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 11 Feb 2014 Link to this post

    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).

  3. Munish
    Munish avatar
    14 posts
    Member since:
    Apr 2013

    Posted 12 Feb 2014 in reply to Dimitrina Link to this post

    Hi Didie

    Yes , I want to access the dataitems bound to the rows which are marked as selected. 
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Feb 2014 Link to this post

    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).

  5. Peter
    Peter avatar
    1 posts
    Member since:
    Nov 2015

    Posted 08 Dec 2016 in reply to Dimitrina Link to this post

    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

  6. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1171 posts

    Posted 12 Dec 2016 Link to this post

    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.
Back to Top