Truedbgrid - grouping and fetchcellstyles event

Posted by: arowland on 4 April 2018, 5:45 am EST

    • Post Options:
    • Link

    Posted 4 April 2018, 5:45 am EST

    I’m using truedbgrid version: 4.0.20172.271. When in normal view the fetchcellstyles event is working fine, however when I group the grid by any column the row index for colouring the cell is offset by the grouping level. If this is an error with the grid then is there a work around please?

    The code I’m using in the event is as follows:

            Dim Amt As Decimal
    
            Amt = Val(Me.tdbGrid(e.Row, e.Col))
    
                If Amt < 0 Then
                    e.CellStyle.ForeColor = Color.Red
                End If
    

    Regards,

    Andy

  • Posted 5 April 2018, 2:05 am EST

    Hello,

    Please use following line of code instead of “e.Row”

    C1TrueDBGrid1.Splits(0).Rows(e.Row).DataRowIndex
    

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels