Hi, I have two dropdownlist template columns in datagrid. Once the first one (Test Type, in column index 2, ID="ddlTestTypeID") selection changed, I need to re-bound the second dropdownlist (test standard, column index 3, ID="ddlTestStandardID"). So for the first dropdown control, I have: OnSelectedIndexChanged="OnDDLTypeModified"
Private Sub OnDDLTypeModified(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ddl As DropDownList = sender
Dim myCache As New UtilityCacheManager() 'user defined class for datasource
Dim dgi As DataGridItem = ddl.NamingContainer
'rebuild datasource for teststand
Dim ddlStand As DropDownList
ddlStand = dgi.Cells(3).FindControl("ddlTestStandardID")
Dim dv As New DataView
dv = New DataView(myCache.RFTData.RFTTestStand) 'data source
dv.RowFilter = "TestType ='" & ddl.SelectedValue & "'"
ddlStand.DataSource = dv
ddlStand.DataBind()
End Sub
dgi.Cells(3).FindControl("ddlTestStandardID") returns 'Nothing'
What I did wrong here? Please help me!
Thanks and regards!
Jin