Protected Sub ProjectGrid_ItemDataBound(sender As Object, e As DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Then
Dim spndropdown As HtmlGenericControl = DirectCast(e.Item.FindControl("spndropdown"), HtmlGenericControl)
Dim spndropdownText As String = spndropdown.InnerHtml
spndropdown.InnerHtml = "Select one"
Dim AlternateDropDownList As HtmlGenericControl = DirectCast(e.Item.FindControl("AlternateDropDownList"), HtmlGenericControl)
Dim strAlternateDropDownList As String = AlternateDropDownList.InnerHtml
AlternateDropDownList.InnerHtml = "flag data"
End If
End Sub
Protected Sub ProjectGrid_ItemCommand(source As Object, e As DataGridCommandEventArgs)
If e.Item.ItemType = ListItemType.Item Then
Dim spndropdown As HtmlGenericControl = DirectCast(e.Item.FindControl("spndropdown"), HtmlGenericControl)
Dim AlternateDropDownList As HtmlGenericControl = DirectCast(e.Item.FindControl("AlternateDropDownList"), HtmlGenericControl)
End If
End Sub
Thanks & Regards
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
asteranup
All-Star
30184 Points
4906 Posts
Re: VB Code, please could somebody help me get the value of dropdown value selected inside of my ...
Apr 04, 2012 04:45 AM|LINK
Hi,
Try this code-
Protected Sub ProjectGrid_ItemDataBound(sender As Object, e As DataGridItemEventArgs) If e.Item.ItemType = ListItemType.Item Then Dim spndropdown As HtmlGenericControl = DirectCast(e.Item.FindControl("spndropdown"), HtmlGenericControl) Dim spndropdownText As String = spndropdown.InnerHtml spndropdown.InnerHtml = "Select one" Dim AlternateDropDownList As HtmlGenericControl = DirectCast(e.Item.FindControl("AlternateDropDownList"), HtmlGenericControl) Dim strAlternateDropDownList As String = AlternateDropDownList.InnerHtml AlternateDropDownList.InnerHtml = "flag data" End If End Sub Protected Sub ProjectGrid_ItemCommand(source As Object, e As DataGridCommandEventArgs) If e.Item.ItemType = ListItemType.Item Then Dim spndropdown As HtmlGenericControl = DirectCast(e.Item.FindControl("spndropdown"), HtmlGenericControl) Dim AlternateDropDownList As HtmlGenericControl = DirectCast(e.Item.FindControl("AlternateDropDownList"), HtmlGenericControl) End If End SubAnup Das Gupta
Mark as Answer if you feel so. Visit My Blog