I have a radcombobox and in that I have placed one checkbox after databinding I want to insert one more checkbox inside that radcombobox to select all items.
<telerik:RadComboBox ID="cmbRoleName" EmptyMessage="- please select group -" runat="server"
AutoCompleteSeparator="true" HighlightTemplatedItems="true"
AutoPostBack="True" AllowCustomText="true" OnClientDropDownClosed="onDropDownClosing">
<Items>
<telerik:RadComboBoxItem Value="0" Text="-- Select All Users --" />
</Items>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:CheckBox runat="server" ID="chkRole" Text='<%#DataBinder.Eval(Container.Dataitem,"RoleName")%>'
Onclick="chkBox_Click(this)" />
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
I have tried to do this on server side like this but the problem is that two checkboxes are appearing one with text and without text. Any Help would be really appreciated.
Protected Sub CreateSelectAllUsersCheckBox()
Dim chkSelectAllUsers As New CheckBox
chkSelectAllUsers.Text = "Select All Users"
chkSelectAllUsers.ID = "chk1"
Dim radComboBoxItem As New RadComboBoxItem
radComboBoxItem.Text = "Select All Users"
radComboBoxItem.Controls.Add(chkSelectAllUsers)
cmbRoleName.Items.Insert(0, radComboBoxItem)
End Sub
<telerik:RadComboBox ID="cmbRoleName" EmptyMessage="- please select group -" runat="server"
AutoCompleteSeparator="true" HighlightTemplatedItems="true"
AutoPostBack="True" AllowCustomText="true" OnClientDropDownClosed="onDropDownClosing">
<Items>
<telerik:RadComboBoxItem Value="0" Text="-- Select All Users --" />
</Items>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:CheckBox runat="server" ID="chkRole" Text='<%#DataBinder.Eval(Container.Dataitem,"RoleName")%>'
Onclick="chkBox_Click(this)" />
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
I have tried to do this on server side like this but the problem is that two checkboxes are appearing one with text and without text. Any Help would be really appreciated.
Protected Sub CreateSelectAllUsersCheckBox()
Dim chkSelectAllUsers As New CheckBox
chkSelectAllUsers.Text = "Select All Users"
chkSelectAllUsers.ID = "chk1"
Dim radComboBoxItem As New RadComboBoxItem
radComboBoxItem.Text = "Select All Users"
radComboBoxItem.Controls.Add(chkSelectAllUsers)
cmbRoleName.Items.Insert(0, radComboBoxItem)
End Sub