0

Hello Everyone,

Could you please tell me why my dropdown not firing selectindexchange event. I have dynamic load that dropdown box using dataset. My problem this I have two dropdown boxes now I have load Brand Information in first one and when I select the brand all printers info load in second dropdown list.

HMTL

<asp:DropDownList ID="ddlSelectBrand" runat="server" 
                                CssClass="Sidebar-DropdownList" AutoPostBack="True" EnableViewState="true" Height="22px" OnSelectedIndexChanged="ddlSelectBrand_SelectedValueChanged">
                                <asp:ListItem Selected="True" Text = "- Select a Brand -"></asp:ListItem>
                            </asp:DropDownList>

Binding Information

ddlSelectBrand.DataSource = wseCommerce.LoadBrand().Tables(0)
        ddlSelectBrand.DataValueField = wseCommerce.LoadBrand().Tables(0).Columns("ManufacturerName").ColumnName.ToString()
        ddlSelectBrand.DataTextField = wseCommerce.LoadBrand().Tables(0).Columns("ManufacturerName").ColumnName.ToString()
        ddlSelectBrand.DataBind()

Event

Protected Sub ddlSelectBrand_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlSelectBrand.SelectedValueChanged
        If ddlSelectBrand.SelectedValue <> "" Then
            ddlSelectCatridge.Enabled = True
            ddlSelectPrinter.Enabled = True

            'Load Printer against Brand Name
            ddlSelectPrinter.DataSource = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0)
            ddlSelectPrinter.DataValueField = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0).Columns("PrinterName").ColumnName.ToString()
            ddlSelectPrinter.DataTextField = wseCommerce.LoadPrinter(ddlSelectBrand.SelectedValue).Tables(0).Columns("PrinterName").ColumnName.ToString()
            ddlSelectPrinter.DataBind()
        Else
            ddlSelectCatridge.Enabled = False
            ddlSelectPrinter.Enabled = False
        End If

    End Sub

hope you would understand my problem.

Thanks

Edited by farooq82: n/a

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by farooq82
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.