Get Select Rows from RadGrid with paging enabled

5 posts, 0 answers
  1. Phaneendra
    Phaneendra avatar
    27 posts
    Member since:
    Jul 2011

    Posted 10 Jun 2013 Link to this post

    Hi,

    I have a rad grid with paging enabled, and i got records displayed in two pages.
    Using client script I'm working for selecting/deselecting the rows using checking box and also persisted the check box while paging.
    But when I'm trying to read selected rows in rad grid I'm getting only current page records, but not all pages selected records.

    Please help me in that regards.

    Thanks & Regards
    Phaneendra
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Smitha
    Smitha avatar
    2 posts
    Member since:
    Sep 2012

    Posted 25 Sep 2014 Link to this post

    function GridCreated(sender, eventArgs) {
    var masterTable = sender.get_masterTableView();
    var selectColumn = masterTable.getColumnByUniqueName("SelectColumnID");
    var headerCheckBox = $(selectColumn.get_element()).find("[type=checkbox]")[0];

    if (headerCheckBox) {
    headerCheckBox.checked = masterTable.get_selectedItems().length ==
    masterTable.get_dataItems().length;
    }
    }
  5. Smitha
    Smitha avatar
    2 posts
    Member since:
    Sep 2012

    Posted 25 Sep 2014 Link to this post

    what is the use of the following code
    Persisting the Selected Rows Client-side on Sorting/Paging/Filtering/Grouping

    http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html

    function GridCreated(sender, eventArgs) {
    var masterTable = sender.get_masterTableView();
    var selectColumn = masterTable.getColumnByUniqueName("SelectColumnID");
    var headerCheckBox = $(selectColumn.get_element()).find("[type=checkbox]")[0];

    if (headerCheckBox) {
    headerCheckBox.checked = masterTable.get_selectedItems().length ==
    masterTable.get_dataItems().length;
    }
    }
  6. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 30 Sep 2014 Link to this post

    Hi Smitha,

    This logic will handle the SelectAll header checkbox state which becomes visible once the AllowMultiRowSelection property is enabled. I'm also attaching a more advanced implementation of the approach demonstrated in the mentioned article.

    Hope this helps.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017