I am trying to create a more detailed item template for a standard CheckBoxList control. It provides an ITemplate property called TemplateControl, but I could not find a simple resource on how to use it. Here is the code that I still have:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) Dim items As New List(Of ListItem) items.Add(New ListItem() With {.Text = "A", .Value = "1"}) items.Add(New ListItem() With {.Text = "B", .Value = "2"}) items.Add(New ListItem() With {.Text = "C", .Value = "3"}) Dim lst As New CheckBoxList() Dim tpl As ITemplate = LoadTemplate("~/CustomListItem.ascx") Dim g As New TemplateControlWrapper() tpl.InstantiateIn(g) lst.TemplateControl = g lst.DataSource = items lst.DataBind() Form.Controls.Add(lst) End Sub Class TemplateControlWrapper Inherits UserControl End Class
It seems to completely ignore the TemplateControl property. Any ideas?
CheckBoxList TemplateControl CheckBoxList. System.Web.UI.Control, , , CheckBoxList, - .aspx,.ascx , . ( , , , TemplateControl null , UserControl.)
CheckBoxList , . , DataList ( CheckBox ItemTemplate), .
... MSDN : http://msdn.microsoft.com/en-us/library/36574bf6.aspx
INamingContainer.
Source: https://habr.com/ru/post/1730913/More articles:How to determine the current version of the operating system in MSBuild? - windowsWix - ComPlusAssembly - Не удалось установить библиотеку типов - wixIs it possible to use javascript to load a JSON object from another domain / server? - jsonLoadString, static library and executables - c ++request data from Sharepoint using Report Builder 2.0: missing fields - xmlDialogPreference should not be closed if the option is not selected - androidКак я могу проверить браузер, чтобы узнать, поддерживает ли он 128-битное шифрование? - cross-browserExamples of filling out a PDF form with iText in ColdFusion - coldfusionAlgorithm to save sorting sorting when pasting in the middle - algorithmpython log viewer application - pythonAll Articles