Grey Line

One piece of this week’s code seemed to be “typical” for UI in List/Tree control – overlay element that needs to be shown on the selected row(s)

Here is the used approach:

1. Inherit new control from the  Tree or List.

2. Define overlayRenderer getter/setter as ClassFactory

3. Override drawItem method of the control. You will need to look in the parent code, and make “if” statement on selected argument – if true, show or make new instance of overlay item and add it as a child to the item being drawn, if false remove/make invisible, and position it within the item.

Upside of such approach is that you do not have “column” of the “overlays” in the tree, but rather just one or few (depending on selection mode)

Enjoy,

Anatole

 

2 Comments »

  1. Campbell said,

    October 1, 2006 @ 3:42 am

    Kewl will have to look into this. Where is the “One piece of this week’s code”, is this on your course?

    Cheers
    Campbell

  2. Anatole Tartakovsky said,

    October 9, 2006 @ 12:36 pm

    That was from the client’s project – small “test case” that is turned to the client for implementation. We are using this approach on custom DataGrid painter to provide visual DataGrid design / selection services on columns and bands
    Regards,
    Anatole

RSS feed for comments on this post · TrackBack URI

Leave a Comment