473,473 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Respond to DropDownList control Event in DataGrid

Ali
I am adding a DropDownList control to my DataGrid footer template. I load
my DropDownList using a function that returns an arrayList. I can see all
my items in the DropDownList, but when I select an item from the list, I am
unable to trap the DropDownList SelectedIndexChanged event.

This is a snippet of my DataGrid:

<asp:TemplateColumn>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "State") %>
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList id="dropDownListState"
DataSource="<%#Load_DropDownListState%>"
OnSelectedIndexChanged="dropDownListStateHandler" AutoPostBack="True" />
</FooterTempalte>
</asp:TemplateColumn>

NOTE: Even the DataGrid ItemCommand event does not fire up when I change the
index on my DropDownList control. I was hopping I can do something like
finding the control inside the ItemCommand Handler " dropDownListState =
myDataGrid.FindControl("dropDownListState").

Please help.

Ali
Nov 18 '05 #1
2 2032
I noticed your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Ali" <el********@hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP10.phx.gbl...
I am adding a DropDownList control to my DataGrid footer template. I load
my DropDownList using a function that returns an arrayList. I can see all
my items in the DropDownList, but when I select an item from the list, I am unable to trap the DropDownList SelectedIndexChanged event.

This is a snippet of my DataGrid:

<asp:TemplateColumn>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "State") %>
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList id="dropDownListState"
DataSource="<%#Load_DropDownListState%>"
OnSelectedIndexChanged="dropDownListStateHandler" AutoPostBack="True" />
</FooterTempalte>
</asp:TemplateColumn>

NOTE: Even the DataGrid ItemCommand event does not fire up when I change the index on my DropDownList control. I was hopping I can do something like
finding the control inside the ItemCommand Handler " dropDownListState =
myDataGrid.FindControl("dropDownListState").

Please help.

Ali

Nov 18 '05 #2
Ali
No, I have not. I decided to pull the dropDownList control from the footer
template. I am using the DropDownList is used for filtering.

Thanks
Ali
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
I noticed your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Ali" <el********@hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP10.phx.gbl...
I am adding a DropDownList control to my DataGrid footer template. I load my DropDownList using a function that returns an arrayList. I can see all my items in the DropDownList, but when I select an item from the list, I

am
unable to trap the DropDownList SelectedIndexChanged event.

This is a snippet of my DataGrid:

<asp:TemplateColumn>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "State") %>
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList id="dropDownListState"
DataSource="<%#Load_DropDownListState%>"
OnSelectedIndexChanged="dropDownListStateHandler" AutoPostBack="True" />
</FooterTempalte>
</asp:TemplateColumn>

NOTE: Even the DataGrid ItemCommand event does not fire up when I change

the
index on my DropDownList control. I was hopping I can do something like
finding the control inside the ItemCommand Handler " dropDownListState =
myDataGrid.FindControl("dropDownListState").

Please help.

Ali


Nov 18 '05 #3

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

Similar topics

1
by: Stanley J Mroczek | last post by:
I am trying to load a dropdownlist in VB when the edit is clicked in a datagrid. How do i call Sub loaddd to load the dropdownlist <asp:TemplateColumn runat="server" HeaderText="Id Type Option"...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
18
by: Julia Hu | last post by:
Hi, I have a datagrid, and in different rows I need to programmatically bind different type of controls and load data into these controls. For example,in the first row I need to bind data into a...
2
by: Dave | last post by:
Hi, I'm building a maintenance form for a table and some of the fields are textboxes (i.e name) and some should be dropdowns (i.e country of origin) When a user clicks 'Edit' in the...
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...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
2
by: steven | last post by:
i've got a dropDownList that I'm trying to populate from my code behind as follows: uxVehicleColourEdit.DataSource = oDsLookups.Tables; if the dropDown is placed inside a datagrid, i get...
0
by: stevem2112 | last post by:
I have a datagrid with 2 Template columns. One column has DropDownLists and the other has Textboxes. I bind each DDL in the ItemCreated event. This datagrid is inside a UserControl that is inside...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.