This is a migrated thread and some comments may be shown as answers.

How to "Select All" ItemTemplate CheckBoxes in a RadComboBox?

1 Answer 114 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jason Zam
Top achievements
Rank 1
Jason Zam asked on 09 Apr 2010, 06:28 PM
Hello,

I have a RadComboBox and have created a Checkbox column via an ItemTemplate.  The RadComboBox is bound dynamically in the code behind. 

Is there an easy way to insert a default record for the RadComboBox on databind, then once that first default record is selected by the user, the rest of the checkboxes in the RadComboBox are selected (acting as a "select all" checkbox)?

Here's my ASPX Code:
<telerik:RadComboBox ID="ddlProjects" EnableScreenBoundaryDetection="False" EmptyMessage="Select Project(s)"  runat="server">  
   <ItemTemplate>   
      <asp:CheckBox runat="server" ID="CheckBox" Text="" /> <%#DataBinder.Eval(Container, "Text")%>   
   </ItemTemplate>    
</telerik:RadComboBox> 

Here's id my VB Code:
    Protected Sub ddlProjects_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlProjects.Load  
        Try  
            If Not Page.IsPostBack Then  
                ddlProjects.DataSource = l_oUniversal.PopulateDropDownList("sprocSchedule_Get_ProjectNames")  
                ddlProjects.DataValueField = "ProjectID" 
                ddlProjects.DataTextField = "ProjectName" 
                ddlProjects.DataBind()  
                ddlProjects.Items.Insert(0, New RadComboBoxItem(""))  
            End If  
        Catch ex As Exception  
            ' Log Error  
        End Try  
    End Sub 

Thanks!
Jason

1 Answer, 1 is accepted

Sort by
0
Jason Zam
Top achievements
Rank 1
answered on 12 Apr 2010, 07:55 PM
I resolved this issue myself via a Javascript method which is called on the Itemtemplate CheckBox
Tags
ComboBox
Asked by
Jason Zam
Top achievements
Rank 1
Answers by
Jason Zam
Top achievements
Rank 1
Share this question
or