Hi,
I'm having an asp dropdownlist with selectedindexchanged event.. I'm having around 4-5 infragistics webddropdown multi select boxes, Whenever user selects options in multidropdown list and again selects the above normal asp dropdownlist, the items selected in the multidropdown should be cleared and initial value should be set to "Please Select"..
How can i implement this in asp dropdownlist selectedindexchanged event??
Can anyone please help me out as its bit urgent..
Thanks,
Please find the attached image of webdropwn behaviour as textbox and i can edit the text as well eventhough there is InputKeyDown function defined.. Please help me fixing this..
Thanks
Petar Ivanov"] function WebDropDown1_InputKeyDown(sender, eventArgs){ eventArgs.set_cancel(true);}
function WebDropDown1_InputKeyDown(sender, eventArgs){ eventArgs.set_cancel(true);}
Hi Ivanov,
Thanks for the comeback.. I tried with the above function but still i'm able to edit text in the WebDropDown..Below is my aspx markup and javascript function..
<ig:WebDropDown runat="server" ID="ddlCBT" EnableClosingDropDownOnSelect="false" EnablePaging="false" Width="200px" DropDownContainerHeight="200px" EnableMultipleSelection="true" MultipleSelectionType="Checkbox" NullText="-Please Select-" DisplayMode="DropDown" > <ClientEvents SelectionChanged="selectedIndexChanged" InputKeyDown="ddlCBT_InputKeyDown" /> </ig:WebDropDown>
<script type="text/javascript" language="javascript"> function ddlCBT_InputKeyDown(sender, eventArgs) { eventArgs.set_cancel(true); }
</script>
kindly help me out, and even the dropdown is behaving like a TextBox
Hi pavanpuligandla,
Thank you for your reply.
In this scenario you may use the DropDown mode and disallow editing of the input field by cancelling the InputKeyDown clientside event. For instance:
Please let me know if this helps.
Thanks alot, It is working fine..I've figured it out at my end where i did wrong.One more issue is i should prevent users from editing the WebDropDown text, I came to know that to achieve this we need to set the property DisplayMode="DropDownList", But wehn i use this, I'm unable to set the CurrentValue as "Please Select" rather the ListItems that were bound from the DB are being selected.
How can i prevent this if i use DisplayMode="DropDownList" or there is any work around to prevent users from entering text in the DropDown if DisplayMode is in DropDown? Either will be fine..
Attached is a sample demonstrating both client and serverside approaches for clearing the selection of WebDropDown. The onchange event of an ASP dropdownlist can be handled (although it would not appear in VS properties) as the control is rendered as a <select> element.
Hope this helps.