How to find the control in EditFormSettings of RadTreeList...

7 posts, 0 answers
  1. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 30 Dec 2014 Link to this post

          As the form is in ContentPlaceHolder of ContentPlage I ikplement the logic like this........     


          ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
                RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1"); 


    after this the result in radbutton1  is null as it doesnt find the control RadButton1....

    please help me in this
  2. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 30 Dec 2014 in reply to Gopi Link to this post

    Pls dont forget that the code is in button click  event..........its not a big deal in finding editcommand and other evnts need to find it in buttonclickevent
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 02 Jan 2015 Link to this post

    Hello Gopi,

    I'm not sure that I understand your scenario completely.

    Why are you looking for the button when you are going to use its click event to find the RadTreeList control? And are these two (RadButton, RadTreeList) located within the same placeholder or they reside on different pages?
    Please provide more information about your scenario as this will help me give you a straight to the point answer.

    Regards,
    Daniel
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 05 Jan 2015 in reply to Daniel Link to this post

    Hello Daniel,

    thanks for getting respond to my Request and I let u very clear on my requiremnt......

    here  I have a radtreelist like as in the picture below(1.PNG) there  when I click on the edit icon I have panel(Capture.png) with selected rowRow Id and otherfiled values....when I click on the Update button I need to retrieve those values and store in a variable.......
  6. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 05 Jan 2015 in reply to Gopi Link to this post

    I can ake use of this code but there is no TreeListCommandEventArgs in click event of button..........


      TreeListCommandEventArgs e1 = new TreeListCommandEventArgs(null, radbutton1.CommandArgument, e2);
                TreeListDataItem dataItem = e1.Item as TreeListDataItem;
                Hashtable table = new Hashtable();
                table["PartyParentRowId"] = (dataItem.FindControl("Label1") as Label).Text;
                table["PartyAlias"] = (dataItem.FindControl("Label2") as Label).Text;
  7. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 05 Jan 2015 Link to this post

    In order to add TreeListCommandEventArgs in button click I also implemented code like this.......


       ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;

                RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1");
                object mysender = (object)radbutton1;
                CommandEventArgs e2 = new CommandEventArgs(null, radbutton1.CommandArgument);
                RadButton1_Click(mysender, e2);
                TreeListCommandEventArgs e1 = new TreeListCommandEventArgs(null, radbutton1.CommandArgument, e2);
                TreeListDataItem dataItem = e1.Item as TreeListDataItem;
                Hashtable table = new Hashtable();
                table["PartyParentRowId"] = (dataItem.FindControl("Label1") as Label).Text;
                table["PartyAlias"] = (dataItem.FindControl("Label2") as Label).Text;      










    But here I am not able to find Radbutton inside the Radtreelist so that I am getting Error......












  8. Gopi
    Gopi avatar
    15 posts
    Member since:
    Jan 2013

    Posted 06 Jan 2015 in reply to Gopi Link to this post

    finally got the output with this..............
    protected void RadButton1_Click(object sender, EventArgs e)
          {
                 
     ContentPlaceHolder contentPage = this.Page.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
               RadButton R = sender as RadButton;
               RadButton radbutton1 = R.Parent.FindControl("RadButton1") as RadButton;
              RadTextBox t = sender as RadTextBox;
               RadTextBox t1 = R.Parent.FindControl("textbox") as RadTextBox;
               Response.Redirect("WebForm1.aspx?PartyParentRowId="+ t1.Text);
               
               }
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017