bubbling event from RadTreeView UC to main page

5 posts, 0 answers
  1. Johann
    Johann avatar
    13 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    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
  2. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 08 Dec 2008 Link to this post

    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Johann
    Johann avatar
    13 posts
    Member since:
    Sep 2008

    Posted 09 Dec 2008 Link to this post

    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
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Dec 2008 Link to this post

    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.
  6. Johann
    Johann avatar
    13 posts
    Member since:
    Sep 2008

    Posted 10 Dec 2008 Link to this post

    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\



Back to Top
UI for ASP.NET Ajax is Ready for VS 2017