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

Select all/none on RadComboBox

1 Answer 129 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 2
Charles asked on 15 Apr 2011, 05:52 PM
I am using a RadComboBox with an ItemTemplate like this (to show checkboxes for each item):

<ItemTemplate>
     <asp:CheckBox runat="server" ID="chk1"/>
      <asp:Label runat="server" ID="lbllist" AssociatedControlID="chk1" Text='<%# Eval("ComputerName") %>'></asp:Label>
</ItemTemplate>

I further need to implement a couple of linkbuttons in a single row at the top that will allow the user to select all or select none. Finally, the alternating grid lines would be a "nice-to-have". I've included a screenshot of the standards that I need to meet. Step two in that graphic is about where I need to be when the user drops down the combo.

Any help would be appreciated. Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 21 Apr 2011, 03:24 PM
Hello Charles,

Regarding these link buttons on the top of the list with RadComboBox items, you could use the header template.

In order to show the number of items selected when the drop-down of the RadComboBox is closed, you should subscribe on the OnClientDropDownClosing client-side event and used the following event handler function:

function OnClientDropDownClosing(sender, args) {
 
    var checkboxes = $telerik.$('input:checkbox:checked', sender.get_dropDownElement());
 
    if (checkboxes.length > 0) {
 
        sender.set_text(checkboxes.length + " Selected")
    }
    else {
 
        sender.set_text("Select one or more");
    }
     
}

I hope this would help you out.


All the best,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ComboBox
Asked by
Charles
Top achievements
Rank 2
Answers by
Dimitar Terziev
Telerik team
Share this question
or