NTreeList custom painting


Author
Message
Eshar Gal
Eshar Gal
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)
Group: Forum Members
Posts: 5, Visits: 1
I need to draw a few lines on a TreeList. For some reason the NTreeList.Paint won't work, is there a way to make it work or any other way to add some custom drawings?

Thanks.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Eshar,

Most of our UI controls has Property Renderer which is responsible for the control's drawing.

In your case to make some custom drawing you should create renderer class that inherits from NTreeViewExRenderer (NTreeList is a child class of NTreeViexEx control so NTreeList use NTreeViewExRenderer as a renderer) and override some of its methods.

For example you can override PaintBackground and add your drawing in it.

public class MyNTreeViewExRenderer : NTreeViewExRenderer
{
    public override bool PaintBackground(NTreeNode node, NTreeViewExPaintContext context)
    {
        //Do your drwawing using context.Graphics. ...
        return base.PaintBackground(node, context);
    }
}

Then you should set an instance of this class to the NTreeList.Renderer.

In this case to be able to view your custom drawing you should have at least one node in your NTreeList.



Best Regards,
Nevron Support Team


Eshar Gal
Eshar Gal
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)
Group: Forum Members
Posts: 5, Visits: 1
Perfect, thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search