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
30
how to add control to dynamic template field in webdatagrid from server side
posted

// Create our template column.
TemplateDataField templateField1 = new TemplateDataField(true);
templateField1.Key = "TemplateField1";
templateField1.Header.Text = "Template Column";
templateField1.ItemTemplate.InstantiateIn(LiteralDisplayName);
WebDataGrid1.Columns.Add(templateField1);

divHeader.Controls.Add(LiteralHeader);
//divDisplayName.Controls.Add(LiteralDisplayName);
divDisplayName.Controls.Add(WebDataGrid1);

Parents
No Data
Reply
  • 3520
    Offline posted

    Hello,

    Detailed information about creating a template in code-behind is provided in "Using Item Template" topic. Sample code, as well as a sample application addressing the same requirement is discussed in this thread.

    Please, let us know if you need further assistance on this matter.

Children
No Data