Hi
I want to use Asp:CheckBox in RadComboBox that users can select any item from my RadComboBox items
I use this Asp code:
and this Cs Code for ItemsRequested event:
When users selecting items (checking CheckBox) i can't get selected items in my CS code!!!
I use this code for get selected items in my Cs:
but q is empty!!!
I want to use Asp:CheckBox in RadComboBox that users can select any item from my RadComboBox items
I use this Asp code:
<telerik:RadComboBox ID="drpEmailAddress" runat="server" Width="98%" Skin="Outlook" EmptyMessage="Select" EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true" EnableAutomaticLoadOnDemand="true" OnItemsRequested="drpEmailAddress_ItemsRequested"> <ItemTemplate> <asp:CheckBox runat="server" ID="chkAddress" Text='<%#Eval("Address")%>'/> </ItemTemplate> </telerik:RadComboBox> and this Cs Code for ItemsRequested event:
protected void drpEmailAddress_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { var q = GetData(e.Text); int itemOffset = e.NumberOfItems; int endOffset = Math.Min(itemOffset + 20, q.Count); e.EndOfItems = endOffset == q.Count; e.Message = GetStatusMessage(endOffset, q.Count);
drpEmailAddress.DataTextField = "Address";
drpEmailAddress.DataValueField = "AddressId";
drpEmailAddress.DataSource = q.Take(20); drpEmailAddress.DataBind(); }
private static string GetStatusMessage(int offset, int total)
{
if (total <= 0)
return "Nothing found";
return String.Format(" <b>1 </b> <b>{0} </b> <b>{1}</b>", offset, total);
}
When users selecting items (checking CheckBox) i can't get selected items in my CS code!!!
I use this code for get selected items in my Cs:
protected void btnSend_Click(object sender, EventArgs e) { var q = (from a in drpEmailAddress.Items where (a.FindControl("chkAddress") as CheckBox).Checked select a).ToList();
}but q is empty!!!