Hey Peeps,
I have a question about the RadComboBox. I'm busy working on a page where we have multiple RadComboBoxes with Checkboxes as its template (we're using Telerik ASP.NET Q1 2009 controls). The combobox is databound using the asp:SqlDataSource component. The reason for this is that I am unable to programmatically load the data as it depends on the selection of the user. Once the user has made his/her selection, I programmatically build up the SQL query and set the SqlDataSource's SelectCommand equal to the new generated query. We also need to have a 'Select All' option at the top of the combobox. I'm adding the item in the code-behind like so:
When I open the drop down list, the first entry is there but is not showing the text value (see screenshot).
The aspx code looks like:
I have also tried adding the item in the aspx file using:
But using the aspx method, the item is not even shown. It only shows when it's added in the code behind BUT the text property displays blank. Any ideas?
I have a question about the RadComboBox. I'm busy working on a page where we have multiple RadComboBoxes with Checkboxes as its template (we're using Telerik ASP.NET Q1 2009 controls). The combobox is databound using the asp:SqlDataSource component. The reason for this is that I am unable to programmatically load the data as it depends on the selection of the user. Once the user has made his/her selection, I programmatically build up the SQL query and set the SqlDataSource's SelectCommand equal to the new generated query. We also need to have a 'Select All' option at the top of the combobox. I'm adding the item in the code-behind like so:
cboCategories.Items.Clear();
cboCategories.Items.Add(
new
RadComboBoxItem(
"Select All"
,
"-2"
));
cboCategories.DataBind();
When I open the drop down list, the first entry is there but is not showing the text value (see screenshot).
The aspx code looks like:
<
telerik:RadComboBox
ID
=
"cboCategories"
runat
=
"server"
Skin
=
"Hay"
EmptyMessage
=
"Select"
AutoPostBack
=
"true"
AppendDataBoundItems
=
"true"
AllowCustomText
=
"true"
Enabled
=
"false"
DataSourceID
=
"sqlCategories"
DataValueField
=
"sigma$ID"
DataTextField
=
"category$Name"
HighlightTemplatedItems
=
"true"
OnClientDropDownClosing
=
"OnClientDropDownClosingHandler"
OnClientDropDownClosed
=
"onDropDownClosing"
Width
=
"324px"
>
<
ItemTemplate
>
<
div
onclick
=
"StopPropagation(event)"
>
<
asp:CheckBox
ID
=
"chkCategories"
runat
=
"server"
onclick
=
"onCheckBoxClick('ctl00_ContentPlaceHolderMain_cboCategories',this,'chkCategories')"
/>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
AssociatedControlID
=
"chkCategories"
>
<%# Container.DataItem != null ? DataBinder.Eval(Container.DataItem, "category$Name") : DataBinder.Eval(Container, "Text") %>
</
asp:Label
>
</
div
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
<
asp:SqlDataSource
ID
=
"sqlCategories"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:SparSQLConnectionString %>" SelectCommand=""></
asp:SqlDataSource
>
I have also tried adding the item in the aspx file using:
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Select All"
Value
=
"-2"
/>
</
Items
>
But using the aspx method, the item is not even shown. It only shows when it's added in the code behind BUT the text property displays blank. Any ideas?