i have problem for the drop down list in the grid view, it not fire the select index changed. I bind the data for the drop down list when the row databound. But when i select the data, it not fire the select index changed. Another drop down list which hard code the item list fired the select index changed. Any idea on this issue, please help. Below is the code behind and the front end code.
<ItemTemplate>
<asp:DropDownList ID="ddlItem" runat="server" Width="80%" AutoPostBack="true" OnSelectedIndexChanged="ddlPrice_SelectedIndexChanged"></asp:DropDownList>
</ItemTemplate>
<ItemTemplate>
<asp:DropDownList runat="server" ID="ddl" AutoPostBack="true" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
<asp:ListItem Text="Compliant" Value="0" />
<asp:ListItem Text="Other Than Serious" Value="1" />
<asp:ListItem Text="Serious" Value="2" />
<asp:ListItem Text="Critical" Value="3" />
</asp:DropDownList>
</ItemTemplate>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim oCategoryDetails As New CategoryDetails
If Not IsPostBack Then
gdCat.DataSource = oCat.Read
gdCat.DataBind()
End If
End Sub
Dim ddl As DropDownList
ddl = DirectCast(e.Row.FindControl("ddlItem"), DropDownList)
If Not ddl Is Nothing Then
If oDS.Tables.Item(0).Rows.Count > 0 Then
ddl.DataSource = oDS
ddl.DataTextField = "ItemName"
ddl.DataValueField = "ItemPrice"
ddl.DataBind()
Else
ddl.Visible = False
End If
End If
If Me.IsPostBack Then
If e.Row.RowType = DataControlRowType.DataRow Then
AddHandler ddl.SelectedIndexChanged, AddressOf ddlPrice_SelectedIndexChanged
End If
End If
End Sub