EditFormSettings EditFormType="Template" with inner user control whose components are all null

2 posts, 0 answers
  1. Iago
    Iago avatar
    13 posts
    Member since:
    Sep 2016

    Posted 16 Oct 2017 Link to this post


    Hello,
    I am using a RadGrid with EditFormSettings EditFormType="Template". 
    I would like to add inside the <FormTemplate> a user control that resides in another library that I had created as an embedded resource library as described here: https://www.codeproject.com/kb/user-controls/embeddedusercontrol.aspx.
    The problem I'm facing is that  when trying to display the edit form, in  Page_Load event inside my user control,  all inner components (textboxes, radwindows, etc.) are null. 
    What am I doing wrong? 

    Another alternative I had thought about would be to wrap my formtemplate in a usercontrol that I would like to store in my controls library. In this case, 
    what would be the UserControlPath? I have found an example with applications root reference (UserControlPath="~/WebUserControl.ascx"), but I was not able to point it to a different assembly.
    Is there any way of creating the user control in code behind and set it to the grid edit form?

    Any help would be appreciated. Thanks in advance.
  2. Rumen
    Admin
    Rumen avatar
    14029 posts

    Posted 19 Oct 2017 Link to this post

    Hello Iago,

    There is a nice example which shows how to load a user control in an edit template: http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx.

    You can examine its code and try to load the user control in a similar way.

    Best regards,
    Rumen
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top