Checkboxes - select all when paging is on

14 posts, 0 answers
  1. Adam Gross
    Adam Gross avatar
    10 posts
    Member since:
    Dec 2009

    Posted 16 Aug 2010 Link to this post

    I want to create a databound RadGrid that with checkboxes in a column and enable a user to check/uncheck all boxes in the dataset, not just what's displayed on in the current paged dataset.  So, if I have 6000 records but only 50 are displayed, I want to be able to Check/Uncheck All and have it check or uncheck all records, not just the 50 displayed.  Then I want to submit this back to the database to update the records.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Aug 2010 Link to this post

    Hi,


    Refer the following forum link which discusses how to select all the rows in grid regardless of paging. Hope it will shed some light in implementing the functionality.
    Checkbox Select - Multiple Pages

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adam Gross
    Adam Gross avatar
    10 posts
    Member since:
    Dec 2009

    Posted 20 Aug 2010 Link to this post

    I am able to get the records to stay selected when paging now.  The challenge is that I have 5000 records that I need to select with a select all checkbox.  I found this post which suggests turning off paging, rebinding, selecting all records,turning back on paging then rebinding.  http://www.telerik.com/community/forums/aspnet/grid/checkbox-select---multiple-pages.aspx.  I have tried that and it works fine for smaller datasets but with 5000 records, it times out.  Is there some other way that I can check all records and still have paging and filtering capability?  I thought about accessing the datasource directly, but I would have to parse the filters in order to affect the correct dataset.
  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 26 Aug 2010 Link to this post

    Hello Adam,

    RadGrid have in memory only current page items. If you need all items you should disable paging. However if you have a lot of records to be displayed there will be performance penalties.

    Regards,
    Nikolay
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 21 Jan 2011 Link to this post

    Hello!

    I just checked out the project pagingsortingwithclientsideselecting-ajax.zip from this Code Library referenced from this page and found a strange behaviour: the 'select all' checkbox gets selected when returning to page 2.

    Steps to reproduce the issue:
    1) Start the project
    2) Select row 1 on page 1
    3) Select row 2 on page 2
    4) Navigate to page 1 and back to page 2
    5) The 'select all' checkbox is selected!!!

    Can someone confirm this? Or even better: is there a workaround for this?

    Regards,
    Tonino.
  7. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 27 Jan 2011 Link to this post

    Hello Tonino,

    The code library is about to be modified with correct code. For your convenience I am attaching how this scenario should be properly implemented.

    Greetings,
    Nikolay
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  8. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 27 Jan 2011 Link to this post

    Hi Nikolay
    Thanks for your reply! Now it works like a charm!

    Another question: is it possible to have this feature (selecting items on more than one page client-side) [feature A] and enable selection of rows just by clicking the checkbox (no selection when row is clicked elsewhere) [feature B].

    The problem that I encountered is that the function CancelNonInputSelect() allows just selection generated by clicking a checkbox. But this interferes with set_selected for the other feature [feature A] ...

    Here some details of the implementation of feature B:

    <ClientEvents OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect" />

    //cancel all select/deselect operation triggered by non-checkbox row clicks
    function CancelNonInputSelect(sender, args) {
       var e = args.get_domEvent();
       //IE - srcElement, Others - target
       var targetElement = e.srcElement || e.target;
       //this condition is needed if multi row selection is enabled for the grid
       if (typeof (targetElement) != "undefined") {
          //is the clicked element an input checkbox? <input type="checkbox"...>
          if (targetElement.tagName.toLowerCase() != "input" &&
             (!targetElement.type || targetElement.type.toLowerCase() != "checkbox")) {
             args.set_cancel(true);
             return;
          }
       }
       else {
          args.set_cancel(true);
          return;
       }
    }

    Regards,
    Tonino.
  9. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 28 Jan 2011 Link to this post

    Hello Tonino,

    You can use
     <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true"></Selecting>

    to enable selection only when GridClientSelectColumn is clicked.

    Greetings,
    Nikolay
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  10. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 31 Jan 2011 Link to this post

    Hi Nikolay
    Thanks for the hint! I wasn't aware of this new setting. That makes it easy!

    I would be helpful to refere to the new feature on this page:
    http://www.telerik.com/community/code-library/aspnet-ajax/grid/clientsideselectcolumn-disallow-other-selection.aspx

    Regards,
    Tonino.
  11. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 31 Jan 2011 Link to this post

    Hi Tonino,

    Thank you for pointing this to us.
    We will update the code library shortly.

    Best wishes,
    Iana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  12. Luis Barahona
    Luis Barahona avatar
    23 posts
    Member since:
    Feb 2005

    Posted 21 Jun 2011 Link to this post

    I'm trying the same links and I get an error(http://www.telerik.com/community/forums/aspnet/grid/checkbox-select---multiple-pages.aspx). How can I achieve selecting all the items from a radgrid not only the ones of the first page of my radgrid when paging is on? the code below will bring the items from the first page only.... and I need to select all the items from the radgrid...
    best regards,
    Luis
    For Each item As GridDataItem In Radgrid1.MasterTableView.Items
     
          
    Next
  13. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 23 Jun 2011 Link to this post

    Hi Luis,

    In fact this is not possible, because the grid is creating only the items for the current page. So the items for the rest of the pages are not available at all.

    Best wishes,
    Iana
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  14. Rajalakshmi
    Rajalakshmi avatar
    1 posts
    Member since:
    Nov 2015

    Posted 30 Nov 2015 Link to this post

    hi,

     Kindly help me how to have a select all option that selects only those entries that are in that particular page alone not the entire dataset.Help to solve the issue

  15. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 09 Dec 2015 Link to this post

    Hello Rajalakshmi,

    The mentioned functionality is the default multi-selection provided by RadGrid:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultcs.aspx

    Do you have something else in mind?

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017