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

Itemtemplate Label

1 Answer 40 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 11 Nov 2011, 02:39 AM
I want to access label field in itemtemplate and change the text at run time when in edit mode.

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 15 Nov 2011, 11:16 AM
Hi Tina,

You could hook the ItemDataBound event of RadTreeList in order to change the text of some control in edit mode. In its body you should check if the currently bounded item is TreeListEditFormItem. If the result of this check is true, you should proceed and cast the item to TreeListEditFormItem. When you have the EditFormItem you could use its FindControl method to find the desired control within the edit form and then you could change its Text property.

You could check this help article for more information on how to access cells and items in RadTreeList.

Additionally, I have created sample project, to illustrate the aforementioned approach.

All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeList
Asked by
Tina
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or