Itemtemplate Label

2 posts, 1 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 10 Nov 2011 Link to this post

    I want to access label field in itemtemplate and change the text at run time when in edit mode.
  2. Answer
    Andrey avatar
    836 posts

    Posted 15 Nov 2011 Link to this post

    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,
    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
Back to Top