grid.clearSelectedItems()

12 posts, 0 answers
  1. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007

    Posted 26 Jul 2010 Link to this post

    Anyone get this method to work?

    I keep getting Object doesn't support this property or method - though I can see the method in the list for the grid I'm trying to clear in the javascript debugger...


            function UnCheckAll() {
                var grid = $find("rgGroupEmail");
               grid.clearSelecteItems();
            }
     
    the rgGroupEmail grid exists, getting the grid in a var -  gridSelectedItems.length returns 274...
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jul 2010 Link to this post

    Hello,


    You should call the clearSelectedItems() method with respect to GridTableView client object. Here is the example.

    Client code:
    function clearSelectedRecords()
    {
     var grid = $find("< %= RadGrid1.ClientID %>");
     grid.get_masterTableView().clearSelectedItems();
    }


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007
  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 27 Jul 2010 Link to this post

    Hello Bill,

    Please check the attached sample page. It is working properly on my end.

    Greetings,
    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. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007

    Posted 27 Jul 2010 Link to this post

    Nope - still getting the object doesn't support this property or method error.
    It does clear the selected items count.

    My grid has a gridclientselectcolumn - is that the problem?

    I know - the column has a select/deselect all checkbox at the top - the customer insists that there be a separate
    button to clear the column....
  7. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 30 Jul 2010 Link to this post

    Hello Bill,

    Could you please try to replicate the error on the project supplied by me in the previous post?

    Greetings,
    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
  8. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 06 Sep 2010 Link to this post

    Hi Nicolay

    I changed your example a bit to so that I have a postback. In the code behind I call the javascript to clear the row selection. Doing so I get the exception "Microsoft JScript runtime error: 'this._owner._selection' is null or not an object" after pressing the button labled "ClearWithPostback".

    What am I doing wrong?

    I there a way to remove the selection in code behind without rebinding the grid?

    Regards,
    Tonino.
  9. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Sep 2010 Link to this post

    Hello Tonino,

    You can simply clear the selected items in the grid from code behind using the ClearSelectedItems() method.

    C#:
    protected void clearwithPostBack_Click(object sender, EventArgs e)
       {
         RadGrid1.MasterTableView.ClearSelectedItems(); // clears the selected item
       }

    Thanks,
    Princy.
  10. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 07 Sep 2010 Link to this post

    Hello Tonino,

    There was issue with clearSelectedItems method of RadGrid client-side in previous version of RadControls for ASP.NET AJAX. I suggest you to try latest version. Calling the client method from server will not change anything.

    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
  11. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 07 Sep 2010 Link to this post

    Hi Nikolay

    In which version is the fix? I'm using version 2010.2.713.

    Regards,
    Tonino.
  12. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 07 Sep 2010 Link to this post

    Hi Tonino,

    The latest official version of RadControls for ASP.NET AJAX is 2010.2.826 (Q2 2010 SP1). Please migrate to it using the steps from here and let us know how it goes.

    Best regards,
    Sebastian
    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
  13. Michael
    Michael avatar
    5 posts
    Member since:
    Jan 2013

    Posted 30 Jan 2013 Link to this post

    If you hook this up to a RadGrid event like Client-Settings-ClientEvents-OnRowDropped in the mark-up

    <telerik:RadGrid ID="RadGrid" ClientSettings-ClientEvents-OnRowDropped="removeSelection"...

    then you'll get passed the event target which will give you a properly scoped reference to the respective grid and MasterTableView object

     

    function removeSelection(e) {

     

    var masterTable = e.MasterTableView;

    masterTable.clearSelectedItems();

    }

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