Hi everyone
I have a problem when I want to edit the value from nested dropdownlist in Gridview, Please, anyone can help me to solve this problem, a great appreciation from me in advance.
here is my sample code ASP.NET with VB.NET
Protected Sub gridview5_rowdatabound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView5.RowDataBound
Dim Columns() As String
Dim myDataset As New DataSet()
Dim i As Integer = 0
Dim x As Integer = 0
Dim strSuburb As String
For i = 0 To GridView5.Columns.Count
strSuburb = (Trim(GridView5.Columns(i).ToString()))
strSuburb = strSuburb.ToUpper()
If (strSuburb = "SUBURB") Then
Exit For
End If
Next
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Ourddl As DropDownList = CType(e.Row.FindControl("dropdownlist3"), DropDownList)
Columns = myValidation.ReturnMoreThanOneSuburbSelect(strServ er, strUsername, strPassword, Trim(e.Row.Cells(1).Text), Trim(e.Row.Cells(2).Text))
Ourddl.DataSource = Columns
Ourddl.ForeColor = Drawing.Color.Red
Ourddl.DataBind()
AddHandler Ourddl.SelectedIndexChanged, AddressOf Ourddl_SelectedIndexChanged
Columns = myNewColumn.Split(",")
For x = 0 To Columns.Length - 1
strSuburb = (Trim(Columns(x).ToString()))
strSuburb = strSuburb.ToUpper()
If (strSuburb = "SUBURB") Then
Exit For
End If
Next
e.Row.Cells(i + x + 2).Controls.Add(Ourddl)
End If
End Sub