Profile Picture

NTreeList custom painting

Posted By Eshar Gal 14 Years Ago
Author
Message
Eshar Gal
Posted 14 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 14 Years Ago
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
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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
Posted 14 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 14 Years Ago
Posts: 5, Visits: 1
Perfect, thanks!



Similar Topics


Reading This Topic