473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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

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
0 1251

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lucifer | last post by:
Hi I am trying to raise a bubble event. I have a dropdownlist and a datalist in a datalist. I want to use the postback from the dropdownlist to rebind the nested datalist. But i need the...
3
by: Tim::.. | last post by:
Can someone please tell me how I go about preselecting an item in a drop drown list when I click the Edit Command in a datagrid? I have tried the following but it doesn't work for me! I would...
1
by: Paul L | last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a DropDownList control which is in the ItemTemplate of a DataList. I have made an exact copy of the DropDownList control,...
1
by: Andy | last post by:
Hello, I have a datagrid which contains DropDownList as follow: <Columns> <asp:TemplateColumn > <ItemTemplate> <asp:DropDownList id=ProductName...
0
by: Bengt-Erik Eliasson | last post by:
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...
0
by: Bengt-Erik Eliasson | last post by:
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...
0
by: Dewey | last post by:
I have a datagrid with a footer that has a dropdownlist. I am able to bind the datagrid to a dataset just fine. But I also want to add a listitem that says "-- choose --" to the top of the list. ...
3
by: Shawn | last post by:
Hi. I have a DataGrid with a DropDownList, like this: <asp:DropDownList id="ddlStatusCode" OnSelectedIndexChanged="SetDirty" runat="server"></asp:DropDownList> If the user selects a new value I...
2
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine...
0
by: | last post by:
I have 2 dropdownlists in the Footer of a datagrid: ddlStartTime and ddlEndTime. Both contain values like "1:00 AM", "1:15 AM", "1:30 AM", etc. There is also a label named lblTimeDiff. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.