By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,683 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,683 IT Pros & Developers. It's quick & easy.

How raise an OnSelectedIndexChanged for an DropDownList in footer of a DataGrid?

P: n/a
Hi!

In a DataGrid I have a 'Add New'-field in the footer. I
want to hide an control (txtNewFe_name) if the value of
cmbNewFe_num is >0. How do I do that? The
OnSelectedIndexChanged does not seem to response to
anything, even though I tryed with just:

Function CheckFe_num()
Response.Write("Hello World!")
End Function

Best regards / Bengt-Erik

MyPage.aspx
.........
.........
<FooterTemplate>
<asp:DropDownList id="cmbNewFe_num" DataSource="<%#
PopulateNewFe_num() %>" DataValueField="Id"
DataTextField="Fe_num" runat="server"
OnSelectedIndexChanged="<%# CheckFe_num() %>"/>
</FooterTemplate>
.........
.........
.........
<FooterTemplate>
<asp:TextBox id="txtNewFe_name" runat="server"
TextMode="MultiLine" />
</FooterTemplate>
........
........

MyPage.aspx.vb
......
......
Function CheckFe_num()
If CType(FindControl("cmbFe_num"),
DropDownList).SelectedItem.Value > 0 Then
CType(FindControl("txtNewFe_name"), TextBox).Text
= ""
CType(FindControl("txtNewFe_name"),
TextBox).Visible = False
Else
CType(FindControl("txtNewFe_name"),
TextBox).Visible = True
End If
End Function
.......
.......
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.