Respond to DropDownList control Event in DataGrid

Discussion in 'ASP .Net Datagrid Control' started by Ali, Feb 12, 2004.

  1. Ali

    Ali Guest

    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
     
    Ali, Feb 12, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
    >
     
    Alvin Bruney [MVP], Feb 14, 2004
    #2
    1. Advertising

  3. Ali

    Ali Guest

    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:...
    > 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" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
     
    Ali, Feb 16, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali
    Replies:
    2
    Views:
    2,650
  2. honcho
    Replies:
    1
    Views:
    6,401
    Curt_C [MVP]
    Jun 28, 2005
  3. WaterWalk
    Replies:
    0
    Views:
    741
    WaterWalk
    Mar 1, 2007
  4. Michelle
    Replies:
    1
    Views:
    253
    Elton Wang
    Apr 8, 2005
  5. Cherry

    DropdownLIst doest not respond to changes

    Cherry, Feb 4, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    111
    Marshal Antony
    Feb 6, 2004
Loading...

Share This Page