as EditTemplate in dynamically created RadGrid

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Jul 2012

    Posted 09 Nov 2012 Link to this post

    I would appreciate help in getting following scenario working:

    On Page_Init, RadGrid is created, with GridTemplateColumn. For this column, I need RadAutoCompleteBox in its EditItemTemplate.

    1. Since EditItemTemplate does not exist untill Edit button is clicked ( "Unable to cast object of type 'Util.MyRadAutoCompleteTemplate' to type 'System.Web.UI.IBindableTemplate'"), I set the custom template as ItemTemplate.

    2. When ItemTemplate is created (Page_Init), I set the DataSource

    3. I tried both InputTypes, text and token

    4. ViewState is enabled

    Result is no lookup happens. I read about supplying the input text to data source query on the Page_Load manually, however I don't see this working with a dynamically created RadGrid.

    Previous attempt includes, creating empty GridTemplateColumn on Page_Init, and adding RadAutoCompleteBox on grid_ItemCreated if in edit mode. In this scenario, item is populated correctly on load, I am able to set selected value on edit item, but main problem still remains, querying does not work.

  2. Nencho
    Nencho avatar
    1643 posts

    Posted 14 Nov 2012 Link to this post

    Hello Michael,

    I can suggest you to refer to our help article, where you could observe how to instantiate the EditItemTemplate in the Page_Init event. In addition, if this does not help, I would like to ask you to open a support ticket, along with a runnable sample attached, which demonstrates the exceptions you had faced.

    Kind regards,
    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