Robert Dannelly blog, Over the internet you can find me by "robert dannelly blog". The blog is an ongoing blog of my software engineering over technologies C#, VB.NET, Java, React, JavaScript, .NET Core Current, SQL Server 7 - Current Version, GIT, GitHub, Jira, Azure, AWS and HTML5. “I have not failed. I've just found 10,000 ways that won't work.” Thomas A. Edison, please click on all links to help support this blog. Thank you. “As an Amazon Associate, I earn from qualifying purchases.”
Tuesday, February 19, 2013
DropDownList set dl.SelectedValue
Private Sub dg_srvc_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dg_srvc.ItemDataBound
If e.Item.ItemType = ListItemType.EditItem Then
Dim dl_span As DropDownList
Dim t As Label
dl_span = CType(e.Item.FindControl("dl_span"), DropDownList)
dl_span.SelectedValue = dl_span.Items.IndexOf(dl_span.Items.FindByText(s_span.Trim.ToLower))
t = CType(e.Item.FindControl("temp"), Label)
t.Text = s_span.Trim
End If
WARNING: ENSURE your values if hard coded match the value from the DB...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment