views:

27

answers:

4

I have a combobox:

<ext:ComboBox ID="cbGroup" runat="server" Width="150" 
        OnItemSelected="cbGroup_ItemSelected">
    </ext:ComboBox>

and a method:

    protected void cbGroup_ItemSelected(object sender, EventArgs e)
    {
        FilterItemSelected(this, new EventArgs());
    }

when the item in the combobox is changed the method isnt triggered.
what am i missing?

A: 

Is ItemSelected the correct event?

Tobiasopdenbrouw
+1  A: 

Based on what I know about the ASP.NET DropDownList control, I would say to look for an AutoPostBack property on the ComboBox and set it to true.

Steve Danner
A: 

I don't know what component framework you're using, but the asp:DropDownList has the OnSelectedIndexChanged event which will be triggered when an item is selected, with the assumption that AutoPostBack is set to true:

<asp:DropDownList AutoPostBack="true" ID="cbGroup" runat="server" Width="150" OnSelectedIndexChanged="cbGroup_ItemSelected"></asp:DropDownList>

Update: As I mentioned in my comment to Philip Smith's answer, I think the problem is that you don't set AutoPostBack to true; without this setting, the control won't trigger the event on the server-side, since AutoPostBack is standard set to false

Giu
+2  A: 

I think you need AutoPostBack="true" on the control.

Philip Smith
Either he's missing the correct event, or he's forgetting to set `AutoPostBack` to `true`; my guess is that it's the latter, since he's using some component framework, and the provided control may have the `OnItemSelected` event.
Giu