Getting count of selected items (i.e. rows) from gridview using Javascript

2 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 16 Feb 2009 Link to this post

    Hi,
        We want to get count of selected items (i.e. rows) from gridview using Javascript. We have used the following script in our code.
      <

    telerik:RadCodeBlock ID="RadCodeBlock" runat="server">

     

        <

     

     

    script type="text/javascript">

     

            function GetSelectedItems()

     

     

             {

     

                    var selectItem = $find("<%= gvQueryList.MasterTableView.ClientID %>").get_selectedItems().length;

     

     

     

     

                    if(selectItem == 0)

     

     

                     {

                            alert(

     

     

    "Please select atleast one query");

     

                            return false;

     

     

                     }

     

                    else if(selectItem >1)

     

     

                     {

                            alert(

     

     

    "Please select only one query");

     

                            return false;

     

     

                     }
                    

    else

     

     

     

                    {

     

     

                            return true;

     

     

                     }

        }

         </

    script>

     

     </

    telerik:RadCodeBlock>

     

     

     

     

     

    The above script is working fine. But it is not working on our server. So is there any problem with our server browser or browser version ? Currently server brower version is IE 7. Can you suggest any other solution for the same using Javascript ?


    Thanks in advance

     

     

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 18 Feb 2009 Link to this post

    Hello Rahul,

    Thank you for contacting us.

    From the information provided so far I am not able to determine the exact source of the issue you are facing.
    I suppose that the problem is not in your server browser or browser version.
    Additionally in order to progress in the resolution of this issue, it will be best if you send me a small project which would allow me to track the issue locally.

    Kind regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top