Hi Keith,
Thanks for contacting Syncfusion support.
We have achieved your requirement “
render the ListBox from the site.Master file”. If we want to bind the dataSource to the control ,we don’t need to define the listbox items in the View page.
Please refer the below code snippet to render our Listbox component with with SQL datasource.
[view page]
<ej:ListBox ID="DrpDwnsql" runat="server" DataTextField="text" DataValueField="id" DataSourceID="SqlDataSource1"></ej:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM [Vehicle]" ConnectionString='<%$ ConnectionStrings:Linq_To_SQLConnectionString %>'></asp:SqlDataSource>
|
[code behind]
protected void Page_Init(object sender, EventArgs e)
{
this.DrpDwnsql.LoadDataOnInit = true;
this.DrpDwnsql.Enabled = true;
}
|
We have prepared a sample based on your requirement. Please get the sample from below location.
Sample :
Listbox
Please let us know if you have any queries.
Regards,
Kalpana K