Wednesday, March 5, 2008

GridView Specific Row Color Through DataBase

-------------------------
Grid Pager Text Visible False
-------------------------
Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete
Dim topRow As GridViewRow = GridView1.TopPagerRow
Dim bottomRow As GridViewRow = GridView1.BottomPagerRow

If (GridView1.PageIndex) = 0 Then
CType(topRow.FindControl("lbPrevious"), LinkButton).Enabled = False
CType(topRow.FindControl("lbPrevious"), LinkButton).CssClass = "DisableLink"

CType(bottomRow.FindControl("lbPrevious"), LinkButton).Enabled = False
CType(bottomRow.FindControl("lbPrevious"), LinkButton).CssClass = "DisableLink"
End If

If (GridView1.PageIndex + 1) = GridView1.PageCount Then
CType(topRow.FindControl("lbNext"), LinkButton).Enabled = False
CType(topRow.FindControl("lbNext"), LinkButton).CssClass = "DisableLink"

CType(bottomRow.FindControl("lbNext"), LinkButton).Enabled = False
CType(bottomRow.FindControl("lbNext"), LinkButton).CssClass = "DisableLink"
End If
End Sub
---------------------------------------------------------------------------
Grid view Row Color specifice with database
----------------------------------------------------------------
Protected Sub gvSelectesdShop_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvSelectesdShop.RowDataBound
' 'If e.Row.RowType = DataControlRowType.DataRow Then
' ' Dim status As Boolean = CType(e.Row.FindControl("Status"), Label).Text
' ' If status = False Then
' ' e.Row.BackColor = Drawing.Color.AntiqueWhite
' ' e.Row.ToolTip = "This Shop is not approved yet!"
' ' End If
' 'End If
'End Sub