Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1250
Load RowEditTemplate dynamically
posted

Hi,

Is it possible to load RowEditTemplate dynamically?

In UltraWebGrid on "Page_Init" I used to do following :

 if (flag)
 {
        m_grid.Bands[0].RowEditTemplate = Page.LoadTemplate("~/Templates/Template1.ascx");
  }
 else
 {
       m_grid.Bands[0].RowEditTemplate = Page.LoadTemplate("~/Templates/Template2.ascx");
 }

How can I do the same thing in WebHierarchicalDataGrid, actually I need to have ability to change template depending on some conditions.

Thanks

 

 

Parents
No Data
Reply
  • 10240
    posted

    Hi AlexanderZh,

    Certainly, you can load the template dynamically. From your example I see your template is wrapped inside a user control.

    Once you load the user control to the form you should be able to do as you wish with it:

    Control myUserControl = (Control)Page.LoadControl("usr.ascx");

                 form1.Controls.Add(myUserControl);

     

    Please let me know if you need any additional assistance regarding this matter.

Children