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 %>');
Javascript
12 Answers
Know the answer? Post it. Somebody with the same question will find it here.
ranjan sahoo191 pointsPosted Sep 27, 2013, 11:19 PM EDT
thanx in advance
Sunny SharmaRank #223 · 11.1K pointsPosted Sep 28, 2013, 2:52 AM EDT
Please share your html code so that we help you quickly and better.
ranjan sahoo191 pointsPosted Sep 29, 2013, 9:12 PM EDT
PERSONAL
Style="width: 100%;" ShowFooter="True">
0
ranjan sahoo191 pointsPosted Sep 29, 2013, 9:13 PM EDT
Former memberPosted Sep 29, 2013, 9:26 PM EDT
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.
Sunny SharmaRank #223 · 11.1K pointsPosted Sep 29, 2013, 10:10 PM EDT
-----------------------------------------------------------
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 :)
ranjan sahoo191 pointsPosted Sep 30, 2013, 12:13 AM EDT
ranjan sahoo191 pointsPosted Sep 30, 2013, 12:19 AM EDT
Former memberPosted Sep 30, 2013, 12:24 AM EDT
Can you please upload screenshot of your gridview (while running)?
Former memberPosted Sep 30, 2013, 2:08 AM EDT
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.
ranjan sahoo191 pointsPosted Sep 30, 2013, 2:14 AM EDT
Former memberPosted Sep 30, 2013, 2:24 AM EDT
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.
1 short reply
ranjan sahoo191 pointsPosted Sep 30, 2013, 1:55 AM EDT