Friday, October 19, 2012

Display Unique Name in Gridview




'Declare in top
  Dim mstrUserName As String

Protected Sub gvDocumentList_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvDocumentList.RowDataBound

        If e.Row.RowType <> DataControlRowType.Header And e.Row.RowType <> DataControlRowType.Footer Then

            '' Find Unique Name

            Dim meString As Label = e.Row.FindControl("meSigLabel")

            If e.Row.DataItemIndex = 0 Then
                mstrUserName = ""
            End If

            If meString.Text = mstrUserName Then
                e.Row.Cells(0).Text = ""
            Else
                mstrUserName = meString.Text
            End If

        End If


    End Sub

No comments:

Post a Comment