Skip to content

Javascript

ranjan sahoo

Asked Sep 27, 2013, 11:02 PM EDT13 answers
Share
LinkedInX
hiiiiii
      

i have a Ajax tabcontainer inside tab container i have create a Gridview.
but i cant' find the gridview value . in java script.
i have write like this.--
var grid = document.getElementById('<%= Gridview1.ClientID %>');

12 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    i have a Ajax tabcontainer inside tab container i have create a Gridview. but i cant' find the gridview value . in java script. i have write like this.-- var grid = document.getElementById('<%= Gridview1.ClientID %>');

    thanx in advance
    0
  • Sunny  Sharma
    0
    Hi Rajan,

    Please share your html code so that we help you quickly and better.
    0
  • 0
    ActiveTabIndex="0">
                                       
                                       
                                           
                                               PERSONAL
                                           
                                           
                                                                                                Style="width: 100%;"  ShowFooter="True">
                                                   
                                                       
                                                          
                                                       
                                                       
                                                           
                                                               
                                                           
                                                           
                                                               
                                                           
                                                           
                                                       
                                                       
                                                           
                                                               
                                                                   
                                                                   
                                                                   
                                                                   
                                                                   
                                                                   
                                                               
                                                           
                                                          
                                                           
                                                            0
    0
  • 0
    i want total of value in dropdownlist in gridview footer
    0
  • 0
    It looks like, the gridview name is wrong in your javascript.
    In your HTML , the gridview id is GridAssessment and in your javascript the control name is 
    GridView1.ClientId. 

    Change your javascript as below,
    var grid = document.getElementById('<%= GridAssessment .ClientID %>');

    Please let me know, if it is not working.
    0
  • Sunny  Sharma
    0
    I also suspect on this line of code in JavaScript block:
    -----------------------------------------------------------
    var grid = document.getElementById('<%= Gridview1.ClientID %>');
    -----------------------------------------------------------

    should be:
    -----------------------------------------------------------
    var grid = document.getElementById('<%= GridAssessment.ClientID %>');
    -----------------------------------------------------------
    as per your code.

    In order to show the total in footer you need to sum the total on RowDataBound and assign it to the label control in footer. Refer to this post:

    http://www.beansoftware.com/ASP.NET-Tutorials/Total-GridView-Footer.aspx

    It will help you achieve this purpose.


    Hope it helps :)
    0
  • 0
    i want in javascript. only dropdownlist value
    0
  • 0
    thanx murali sir. but how cant it possbile to know total value in javascript
    0
  • 0
    Should be possible. 
    Can you please upload screenshot of your gridview (while running)?
    0
  • 0
    Here is the logic,

    During the databound event, add the javascript for the dropdownlist selectionchanged event.

    In the comobox_selectionchangedEvent()
    {
     //Fetch all the dropdowlist controls from the datagrid. use document.getElementsByTagName()
    // get the value from the dropdownlist controls
    // Sum-up the values.
    //Find the footer control in the gridview control and bind the value there.
    }

    Please let me know, if you need more help.
    0
  • 0
    I want a function in javascript . and that fuction can be call in dropdownlist onchange event
    0
  • 0
    The below logic is for javascript only.

    In the dropdown_selectionchangedEvent()
    {
     //Fetch all the dropdowlist controls from the datagrid. use document.getElementsByTagName()
    // get the value from the dropdownlist controls
    // Sum-up the values.
    //Find the footer control in the gridview control and bind the value there.
    }

    I don't have visual studio to create the complete set. Let me try with Notepad and IE browser for the javascript part.
    0
  • 1 short reply