You can save the XML definition structure as a file and bind the ComboBox by specifying the
StructureFileURL property.
<APNSoft:APNSoftComboBox id="myComboBox" runat="server"
StructureFileURL = "~/Structures/ComboBox.xml" />
You can also apply the XML Document with structure by using the
DataSource property. If the control loads structure from the database, you should set the
DataSource property to specify a source of data and call the
DataBind() method. To create an appropriate table in the SQL Server, use the following SQL command:
CREATE TABLE [dbo].[Items](
[id] [nvarchar](20) NOT NULL,
[Type] [nvarchar](10) NOT NULL CONSTRAINT [DF_Items_Type] DEFAULT ('item'),
[title] [nvarchar](250) NULL,
[href] [nvarchar](250) NULL,
[target] [nvarchar](100) NULL,
[icon] [nvarchar](100) NULL,
[iconOver] [nvarchar](100) NULL,
[iconWidth] [tinyint] NULL,
[iconHeight] [tinyint] NULL,
[AutoPostBackOnItemClick] [bit]
NOT NULL CONSTRAINT [DF_Items_AutoPostBackOnItemClick] DEFAULT ((0)),
[ClientSideOnItemClick] [nvarchar](250) NULL,
[selected] [bit] NOT NULL CONSTRAINT [DF_Items_selected] DEFAULT ((0)),
[leftSpan] [smallint] NULL
)
You can also build up ComboBox at runtime. APNSoft ComboBox provides an extremely rich and powerful server-side API allowing developer to add, remove or edit elements and element collections. You can programmatically control any item at runtime by using two classes
ComboBoxElement and
ComboBoxElementCollection.