7 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2012, 12:41 PM
Hi,
Try accessing the Detailtemplate as shown below.
aspx:
C#:
Thanks,
Shinu.
Try accessing the Detailtemplate as shown below.
aspx:
<
telerik:RadTreeList
runat
=
"server"
ID
=
"RadTreeList1"
DataSourceID
=
"SqlDataSource1"
AutoGenerateColumns
=
"false"
onitemcommand
=
"RadTreeList1_ItemCommand"
>
<
DetailTemplate
>
<
asp:Button
ID
=
"Button1"
CommandName
=
"Select"
runat
=
"server"
Text
=
"select"
/>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
></
asp:TextBox
>
</
DetailTemplate
>
<
Columns
>
. . .
</
Columns
>
</
telerik:RadTreeList
>
protected
void
RadTreeList1_ItemCommand(
object
sender, Telerik.Web.UI.TreeListCommandEventArgs e)
{
if
(e.CommandName ==
"Select"
)
{
TreeListDetailTemplateItem item = (TreeListDetailTemplateItem)e.Item;
TextBox txt = (TextBox)item.FindControl(
"TextBox1"
);
}
}
Thanks,
Shinu.
0
Nikhil
Top achievements
Rank 1
answered on 11 Sep 2012, 12:50 PM
Hi Shinu,
I already tried what you suggested. Giving me the below mentioned error for casting, since my
is in TreeListTemplateColumn.
Thanks
I already tried what you suggested. Giving me the below mentioned error for casting, since my
<
asp:Button
ID
=
"Button1"
CommandName
=
"Select"
runat
=
"server"
Text
=
"select"
/>
is in TreeListTemplateColumn.
Thanks
0
Gopi
Top achievements
Rank 2
answered on 30 Dec 2014, 01:06 PM
Hi srinu,
ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1");
here I am not able to find rad
ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1");
here I am not able to find rad
0
Gopi
Top achievements
Rank 2
answered on 30 Dec 2014, 01:10 PM
Hi srinu,
ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1");
here I am not able to findRadButton1
ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1");
here I am not able to findRadButton1
0
Hi Gopi,
If your RadButton is placed in a TreeListItem, you should use the FindControl method from that item, because it could not be found from the ContentPlaceHolder.
If you need any further assistance with this, please elaborate on your exact scenario, so we can give an example, relevant to it.
Best Regards,
Konstantin Dikov
Telerik
If your RadButton is placed in a TreeListItem, you should use the FindControl method from that item, because it could not be found from the ContentPlaceHolder.
If you need any further assistance with this, please elaborate on your exact scenario, so we can give an example, relevant to it.
Best Regards,
Konstantin Dikov
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.
0
Gopi
Top achievements
Rank 2
answered on 06 Jan 2015, 03:28 PM
ContentPlaceHolder contentPage = this.Page.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
RadButton R = sender as RadButton;
RadButton radbutton1 = R.Parent.FindControl("RadButton1") as RadButton;
}
0
Hello Gopi,
As I have explained in my previous posts, in order to get reference to a control placed within a a RadTreeList item, you should call the FindControl method from that item.
Once again, if you continue to have problems with this, please provide more details on your exact scenario and the requirement that you have.
Regards,
Konstantin Dikov
Telerik
As I have explained in my previous posts, in order to get reference to a control placed within a a RadTreeList item, you should call the FindControl method from that item.
Once again, if you continue to have problems with this, please provide more details on your exact scenario and the requirement that you have.
Regards,
Konstantin Dikov
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.