M
Me LK
I have a nested dropdown inside a datagrid. One for colors one for
sizes. Not all items have colors or sizes, however, so I need to find
a way to detect if the drop down is blank and make the control not
visible. If there is a value then I need to add a choose a size. I am
having no problem with the choose a size being added to the control.
It just does not recognize when the value is null or blank. The
control is still visible.
Dim myDataGridITem As DataGridItem
For Each myDataGridITem In itemInfo.Items
Dim ddlPsize As DropDownList
ddlPsize = (myDataGridITem.FindControl("ddlsizes"))
If ddlPsize.DataTextField Is GetType(DBNull) Then
ddlcolors.Visible = False
Else
ddlPsize.Items.Insert(0, "Choose a Size")
End If
Next
sizes. Not all items have colors or sizes, however, so I need to find
a way to detect if the drop down is blank and make the control not
visible. If there is a value then I need to add a choose a size. I am
having no problem with the choose a size being added to the control.
It just does not recognize when the value is null or blank. The
control is still visible.
Dim myDataGridITem As DataGridItem
For Each myDataGridITem In itemInfo.Items
Dim ddlPsize As DropDownList
ddlPsize = (myDataGridITem.FindControl("ddlsizes"))
If ddlPsize.DataTextField Is GetType(DBNull) Then
ddlcolors.Visible = False
Else
ddlPsize.Items.Insert(0, "Choose a Size")
End If
Next