Is there any problems with the codes?
Protected Sub dgResult_ItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgResult.ItemDataBound

Dim empID As String = Session("EmpID").ToString()

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

Dim intRow As Integer = e.Item.ItemIndex

If intRow = -1 Then

Exit Sub

End If


Dim ddl As DropDownList

ddl = New DropDownList

ddl = TryCast(e.Item.Cells(e.Item.Cells.Count - 1).FindControl("ddlClassificationType"), DropDownList)

ddl.DataSource = appDetailDBA.getClassificationType()

ddl.DataTextField = "ClassDesc"

ddl.DataValueField = "ClassDesc"

ddl.DataBind()

Dim CurrentDrop As String

Dim itemSub As ListItem = Nothing

Dim dstTempData As DataTable = appDetailDBA.getDataClassification(empID, txtSearch.Text)

CurrentDrop = dstTempData.Rows(intRow)("ClassificationType")

itemSub = ddl.Items.FindByValue(CurrentDrop)

If Not itemSub Is Nothing Then

itemSub.Text = "* " + itemSub.Text

itemSub.Selected = True

End If

If reviewerID.ToString().Equals("") Then

reviewerID = appDBA.getUserIDByEmployeeID(empID)

End If

Dim dataOwner As String = e.Item.Cells(4).Text

If reviewerID.ToUpper().Trim <> dataOwner.ToUpper().Trim() Then

Dim lblClassType As Label = New Label()

lblClassType.Text = itemSub.Text

ddl.Visible = False

e.Item.Cells(7).Controls.Add(lblClassType)

End If

End If

End Sub


Is there any problems with the codes?
===

Protected Sub dgResult_ItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgResult.ItemDataBound

Dim empID As String = Session("EmpID").ToString()

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

Dim intRow As Integer = e.Item.ItemIndex

If intRow = -1 Then

Exit Sub

End If


Dim ddl As DropDownList

ddl = New DropDownList

ddl = TryCast(e.Item.Cells(e.Item.Cells.Count - 1).FindControl("ddlClassificationType"), DropDownList)

ddl.DataSource = appDetailDBA.getClassificationType()

ddl.DataTextField = "ClassDesc"

ddl.DataValueField = "ClassDesc"

ddl.DataBind()

Dim CurrentDrop As String

Dim itemSub As ListItem = Nothing

Dim dstTempData As DataTable = appDetailDBA.getDataClassification(empID, txtSearch.Text)

CurrentDrop = dstTempData.Rows(intRow)("ClassificationType")

itemSub = ddl.Items.FindByValue(CurrentDrop)

If Not itemSub Is Nothing Then

itemSub.Text = "* " + itemSub.Text

itemSub.Selected = True

End If

If reviewerID.ToString().Equals("") Then

reviewerID = appDBA.getUserIDByEmployeeID(empID)

End If

Dim dataOwner As String = e.Item.Cells(4).Text

If reviewerID.ToUpper().Trim <> dataOwner.ToUpper().Trim() Then

Dim lblClassType As Label = New Label()

lblClassType.Text = itemSub.Text

ddl.Visible = False

e.Item.Cells(7).Controls.Add(lblClassType)

End If

End If

End Sub

