Hi,
I have a webdropdown with EnableMuiltipleSelection = True. The webdropdown is bound to a SQL datasource. I am not using lazy loading.
How can I select all items listed in the drop down? Is there a property I can set to enable the user to select all items or do I need to add an additional item to the drop called "All" in my code behind? How would I do that in VB please?
<
ig:WebDropDown ID="wddEmpDept" runat="server" Width="230px" EnableClosingDropDownOnSelect="False" EnableMultipleSelection="True"TextField="DeptName" ValueField="DeptID" DataSourceID="sdsDepartment" ></ig:WebDropDown>
Thank you.
I am getting "unable to get property 'get_items' of undefined or null reference" error. Please advice.
Hi maya,
how to style the "select all" text of input type as like other drop down items..
Regards,
Roopa
Where in the documentation is "set_currentValue) explained?
Thank you, this looks like it will work for me.
Hello,
Thank you for posting in our forum.
Select all functionality is currently not an available feature but you can manually implement this by following these steps:
1. Create a header template with a check box inside.
<HeaderTemplate>
<input type="checkbox" id="chkBox" onchange="return CheckChanged(event);" />
Select All
</HeaderTemplate>
2.In the onChange client side event manually select and deselect all item and set the corresponding values in the input box.
function CheckChanged(e) {
var value="";
var wdd = $find("WebDropDown1");
for (var i = 0; i < wdd.get_items().getLength(); i++) {
if (e.target.checked) {
value+= wdd.get_items().getItem(i).get_text()+", ";
wdd.get_items().getItem(i).select(false);
}
else {
wdd.get_items().getItem(i).unselect(false);
wdd.set_currentValue(value,true);
wdd.closeDropDown();
Please refer to the attached sample and let me know if you have any questions or concerns regarding this.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support