Respond to DropDownList control Event in DataGrid

A

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
 
A

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 said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top