GridView - Making font bold conditionally

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yaksandcows
    New Member
    • Feb 2008
    • 2

    GridView - Making font bold conditionally

    I've just begun developing my first ASP .NET website using VWD2008 with VB.

    I am querying an SQL database to fill a gridview. If the text displayed in a gridview cell = a certain value contained in another SQL table, i need the text to turn bold.

    I have been experimenting with RowDataBound and RowCreated events, but to no avail.

    Example of something i've tried:

    Protected Sub GridView1_RowDa taBound(ByVal sender As Object, ByVal e As System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles GridView1.RowDa taBound

    If e.Row.RowType = DataControlRowT ype.DataRow Then
    Dim myLabel As Label = CType(e.Row.Fin dControl("lblTo talPoints"), Label)

    If myLabel.Text = "1" Then
    myLabel.Font.Bo ld = True
    End If

    End If
    End Sub

    Any help would be greatly appreciated.
  • yaksandcows
    New Member
    • Feb 2008
    • 2

    #2
    ............... ............... ............... ............... ............... ............... ............... ..

    Comment

    Working...