Click here to Skip to main content
15,894,955 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralDisable Tabbed browsing using javascript Pin
manowj25-Oct-10 1:57
manowj25-Oct-10 1:57 
GeneralRe: Disable Tabbed browsing using javascript Pin
Steve Echols25-Oct-10 15:58
Steve Echols25-Oct-10 15:58 
GeneralRe: Disable Tabbed browsing using javascript Pin
moocr.com1-Nov-10 15:32
moocr.com1-Nov-10 15:32 
QuestiongetElementById not working in Windows Mobile 5.0 Pin
Rahul Chitte24-Oct-10 21:19
Rahul Chitte24-Oct-10 21:19 
QuestionUsing Google Analytics _trackEvent() Pin
BDMaruf24-Oct-10 3:53
BDMaruf24-Oct-10 3:53 
AnswerRe: Using Google Analytics _trackEvent() Pin
Md. Marufuzzaman24-Oct-10 3:58
professionalMd. Marufuzzaman24-Oct-10 3:58 
QuestionFind Gridview Footer Row Pin
SatyaKeerthi1522-Oct-10 1:27
SatyaKeerthi1522-Oct-10 1:27 
AnswerRe: Find Gridview Footer Row Pin
Steve Echols25-Oct-10 16:22
Steve Echols25-Oct-10 16:22 
Here's one way to do it:

1) You need to give your gridview footer row an ID.

You can do this in RowCreated (sorry it's VB, that's the project I had open at the moment Smile | :) ):

Protected Sub gvT_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvT.RowCreated

    If e.Row.RowType = DataControlRowType.Footer Then
        e.Row.ID = "theFooter"
    End If

End Sub


This will give you a footer row like <tr id='ctl00_gvT_theFooter'>

Now to get at it using javascript do something like:

function toggleFooter()
{
    var ftr = document.getElementById('<%=gvT.ClientID %>_theFooter');
    if (ftr.style.display != 'none')
        ftr.style.display = 'none';
    else
        ftr.style.display = '';
}


2) If you're using templatefields in your grid view something like:

<asp:gridview id="gvT" runat="server" showfooter="true" autogeneratecolumns="false">
	<columns>
		<asp:templatefield>
			<itemtemplate>
				<%#Eval("MyField") %>
			</itemtemplate>
			<footertemplate>
				<asp:label id="lblFooterLabel1" runat="server"></asp:label>
			</footertemplate>
		</asp:templatefield>
	</columns>
</asp:gridview>


You can access it using:

function getFooterLabel()
{
    var lbl = document.getElementById('&<%=gvT.ClientID %>_theFooter_lblFooterLabel1');
            return lbl;
}


- S
50 cups of coffee and you know it's on!
Code, follow, or get out of the way.

Questiondom childNodes problem Pin
ekba8919-Oct-10 5:34
ekba8919-Oct-10 5:34 
AnswerRe: dom childNodes problem Pin
Gerben Jongerius20-Oct-10 2:45
Gerben Jongerius20-Oct-10 2:45 
GeneralRe: dom childNodes problem Pin
ekba8920-Oct-10 8:41
ekba8920-Oct-10 8:41 
QuestionDocument.Write not working. Pin
thebiostyle14-Oct-10 14:54
thebiostyle14-Oct-10 14:54 
AnswerRe: Document.Write not working. Pin
Dr.Walt Fair, PE14-Oct-10 15:18
professionalDr.Walt Fair, PE14-Oct-10 15:18 
GeneralRe: Document.Write not working. Pin
thebiostyle14-Oct-10 17:39
thebiostyle14-Oct-10 17:39 
AnswerRe: Document.Write not working. Pin
Pete O'Hanlon14-Oct-10 22:46
mvePete O'Hanlon14-Oct-10 22:46 
GeneralRe: Document.Write not working. [modified] Pin
thebiostyle15-Oct-10 6:50
thebiostyle15-Oct-10 6:50 
GeneralRe: Document.Write not working. Pin
thebiostyle25-Oct-10 6:14
thebiostyle25-Oct-10 6:14 
QuestionError in developing my first AJAX example. . . . Pin
khurram_shahzad14-Oct-10 6:03
khurram_shahzad14-Oct-10 6:03 
AnswerRe: Error in developing my first AJAX example. . . . Pin
Eddy Vluggen14-Oct-10 6:46
professionalEddy Vluggen14-Oct-10 6:46 
GeneralRe: Error in developing my first AJAX example. . . . [modified] Pin
Shantanu Gupta 133723-Oct-10 11:08
Shantanu Gupta 133723-Oct-10 11:08 
AnswerRe: Error in developing my first AJAX example. . . . Pin
moocr.com1-Nov-10 15:49
moocr.com1-Nov-10 15:49 
QuestionRetrieving data from an access database and show it to the user. Pin
gamer112711-Oct-10 3:04
gamer112711-Oct-10 3:04 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
Eddy Vluggen14-Oct-10 6:45
professionalEddy Vluggen14-Oct-10 6:45 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
Sanket898924-Oct-10 8:24
Sanket898924-Oct-10 8:24 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
V.25-Oct-10 4:15
professionalV.25-Oct-10 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.