This is a migrated thread and some comments may be shown as answers.

bubbling event from RadTreeView UC to main page

4 Answers 85 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Johann
Top achievements
Rank 1
Johann asked on 08 Dec 2008, 02:51 PM
Hi All

I have moved the RadTreeView to a UC.

How i wish that when the user clicks on a node, the event is bubbled to the main page, and then the RadGridView is bound.

At the moment in the UC, I have the following:-

protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        //lblError.Visible = false;
        //lblError.Text = "";
        RadTreeNode nodeEdited = e.Node;
        ViewState["nodeLevel"] = e.Node.Level;
        ViewState["FullPath"] = e.Node.FullPath;
        ViewState["Value"] = e.Node.Value;
        //pnlCrawledBuildDetailExtended.Visible = false;
        BindGridView();
    }

How can I bubble the BindGridView() to the Main Page, and bind the gridview on the main page?

Thanks for your help

Johann

4 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 08 Dec 2008, 06:15 PM
Hey Johann,

This forum post from forums.asp.net seems to do the trick, I even like the approach they used on it. :)

Bubble Event from UserControl
http://forums.asp.net/t/1138191.aspx

Let us know if that works for you!
0
Johann
Top achievements
Rank 1
answered on 09 Dec 2008, 09:22 AM
Hi Serrin

I saw that example already to tell you the truth, and would work for normal controls.

However my problem is, for example, how to add an event handler to the NodeClick of the RadTreeView?

I tried something like

RadTreeView1.NodeClickEvent += new EventHandler(RadTreeView1_NodeClick);
But no success.

I would like to see an example of a RadTreeView UC

Thanks for your help

Johann
0
Atanas Korchev
Telerik team
answered on 09 Dec 2008, 09:58 AM
Hello Johann,

The name of the event is NodeClick not NodeClickEvent.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Johann
Top achievements
Rank 1
answered on 10 Dec 2008, 04:59 PM
Hi Albert

I tried this

        this.Load += new EventHandler(this.Page_Load);
        RadTreeView1.NodeClick += new Forms_Client.NodeClickDelegate(RadTreeView1_NodeClick);

However its throwing an error:-

Error    117    'ASP.controls_productsradtreeview_ascx' does not contain a definition for 'NodeClick' and no extension method 'NodeClick' accepting a first argument of type 'ASP.controls_productsradtreeview_ascx' could be found (are you missing a using directive or an assembly reference?)    C:\Enlistments\QuintDevelopers\private\Website\TestProductRadGridView.aspx.cs    20    22    C:\...\Website\
Error    118    The type or namespace name 'Forms_Client' could not be found (are you missing a using directive or an assembly reference?)    C:\Enlistments\QuintDevelopers\private\Website\TestProductRadGridView.aspx.cs    20    39    C:\...\Website\



Tags
TreeView
Asked by
Johann
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Johann
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or