Search code examples
smartclient

On demand color set of rows in SmartClient (TreeGrid)


I have a TreeGrid in SmartClient. Now I want to color some set of lines like line numbers 3-5, 7-11 etc. I am using an external button which passes the values to the SmartClient. Can anybody tell me how to do that? A button is passing the value and it's working fine. But the problem is, where to get the value in SmartClient and how can I color that set of lines.


Solution

  • Since TreeGrid is a ListGrid, I would imagine you could override the getCellStyle function and set the colors as you see necessary.

    http://www.smartclient.com/docs/8.1/a/b/c/go.html#search=getcellstyle

    So basically in pseudo code:

    if (row >= 3 and row <=5)
         return "style1"
    if (row >= 7 and row <=11)
         return "style2"
    else
         return this.baseStyle
    

    where style1 and 2 are defined in css