Good morning,
I have 2 cascading dropdownlists and am attempting to bind the child dropdownlist to the parent one. I found the following code online that should rectify my issue, but need assistance utilizing it, as I am using Linq to SQL data source.
I receive an error at DataRowview, whch states "Type DataRowview is not defined"
Would anyone be so kind as to asssit me in replacing DataRovView.
Thanks so much
Sydney
I have 2 cascading dropdownlists and am attempting to bind the child dropdownlist to the parent one. I found the following code online that should rectify my issue, but need assistance utilizing it, as I am using Linq to SQL data source.
Code:
Protected Sub ddlContact1_DataBound(ByVal sender As Object, ByVal e As EventArgs)
Dim ddl As DropDownList = CType(sender, DropDownList)
Dim frmV As FormView = CType(ddl.NamingContainer, FormView)
If Not frmV.DataItem Is Nothing Then
Dim strCity As String = CType(frmV.DataItem, DataRowView)("contactcode")
ddl.ClearSelection()
Dim li As ListItem = ddl.Items.FindByValue(strCity)
If Not li Is Nothing Then li.Selected = True
End If
'add an empty item title "make a selection"
AddEmptyItem(ddl)
End Sub
I receive an error at DataRowview, whch states "Type DataRowview is not defined"
Would anyone be so kind as to asssit me in replacing DataRovView.
Thanks so much
Sydney