/// <summary> /// Initializes the template for the MultiFormView control /// represented by the specified TemplateType. /// </summary> /// <param name="type">A TemplateType enum value representing the type of template.</param> protected void InitTemplate(TemplateType type) { if (_paths != null && _paths.ContainsKey(type)) { IList typePaths = _paths[type]; String[] paths = new String[typePaths.Count]; for (int i = 0; i < typePaths.Count; i++) { paths[i] = ((TemplatePath)typePaths[i]).Path; } MultiBindableTemplate template = new MultiBindableTemplate(this.Page, paths); switch (type) { case TemplateType.EditItemTemplate: EditItemTemplate = template; break; case TemplateType.EmptyDataTemplate: EmptyDataTemplate = template; break; case TemplateType.FooterTemplate: FooterTemplate = template; break; case TemplateType.HeaderTemplate: HeaderTemplate = template; break; case TemplateType.InsertItemTemplate: InsertItemTemplate = template; break; case TemplateType.PagerTemplate: PagerTemplate = template; break; default: ItemTemplate = template; break; } } }
/// <summary> /// Initializes the template for the MultiFormView control /// represented by the specified TemplateType. /// </summary> /// <param name="type">A TemplateType enum value representing the type of template.</param> protected void InitTemplate(TemplateType type) { if ( _paths != null && _paths.ContainsKey(type) ) { IList typePaths = _paths[type]; String[] paths = new String[typePaths.Count]; for ( int i = 0; i < typePaths.Count; i++ ) { paths[i] = ( (TemplatePath) typePaths[i] ).Path; } MultiBindableTemplate template = new MultiBindableTemplate(this.Page, paths); switch ( type ) { case TemplateType.EditItemTemplate: EditItemTemplate = template; break; case TemplateType.EmptyDataTemplate: EmptyDataTemplate = template; break; case TemplateType.FooterTemplate: FooterTemplate = template; break; case TemplateType.HeaderTemplate: HeaderTemplate = template; break; case TemplateType.InsertItemTemplate: InsertItemTemplate = template; break; case TemplateType.PagerTemplate: PagerTemplate = template; break; default: ItemTemplate = template; break; } } }