Setting Color To Multiple Rows

Originally Posted 20 December 2011, 3:14 pm EST

  • Originally Posted 20 December 2011, 3:14 pm EST

    I m new to True DBGrid,

    There are n number of rows in grid in that 1st Column(Rows Contains Either 'X' or Blank),

    If the Rows contains 1st Column as 'X' then i want to make that row colour red

    Please Help its Urgent.

    Pls Provide VB6.O Code

    And Also using FetchRowStyle function

  • Reply


    Can you try this

    Private Sub Form_Load()
    Set RSClone = Adodc1.Recordset.Clone()

    Dim x As Integer

    For x = 1 To TDBGrid1.Columns.Count - 1
    TDBGrid1.Columns(x).FetchStyle = dbgFetchCellStyleColumn

    Next x
    TDBGrid1.FetchRowStyle = True
    End Sub

    Private Sub TDBGrid1_FetchRowStyle(ByVal Split As Integer, Bookmark As Variant, ByVal RowStyle As TrueOleDBGrid80.StyleDisp)

    TDBGrid1.Bookmark = Bookmark
    If TDBGrid1 = "Allen Clark" Then RowStyle.BackColor = vbRed

    End Sub
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels