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,
Any solution for deselecting the infragistics multidropdown list items whenever asp drodownlist selectedindex is changed??
Please share any scripts for this
Hi pavanpuligandla,
Thank you for posting in the community.
A very similar scenario has been discussed at:
http://community.infragistics.com/forums/p/30177/161244.aspx
Below is some sample code illustrating a sample clientside handler for the ASP dropdownlist's onchange event.
Alternatively, the dropdown selection may be cleared on the server by calling the ClearSelection() method.
Hope 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..
Thanks
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:
function WebDropDown1_InputKeyDown(sender, eventArgs){ eventArgs.set_cancel(true);}
Please let me know if this helps.
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..
Can you be able to reproduce this issue? Any help is appreciated..
Apologies, please ignore my last suggestion. A possible way to tackle this may be to keep the display mode of the control to "DropDownList" and set the value of the dropdown's input element as needed.
For instance:
//unselect and inactivate the selected items while (dropdown.get_selectedItems().length > 0) { dropdown.get_selectedItems()[0].inactivate(); dropdown.get_selectedItems()[0].unselect(); } //set some default value in the dropdown's input field ig_controls.WebDropDown1._elements["Input"].value = "Default value";
//unselect and inactivate the selected items while (dropdown.get_selectedItems().length > 0) { dropdown.get_selectedItems()[0].inactivate(); dropdown.get_selectedItems()[0].unselect(); }
//set some default value in the dropdown's input field ig_controls.WebDropDown1._elements["Input"].value = "Default value";
Please let me know if you have any questions.
Petar Ivanov"]After consulting with our developers regarding this matter it was determined that the behavior is most likely related to a development issue (as your requirement should be achievable by only setting EnableCustomValues to false which currently still allows editing through the delete and backspace buttons). In order to ensure that the matter will receive attention I have logged this behaviors in our internal tracking system with a Development IDs 111865. The next step would be for a developer to research the issues and confirm my findings or offer some resolution.
Dear Petar,
Many thanks for you concern on the issue we are facing, Sure will update if i get any breakthrough.. Again thanks for the support, Good work and keep going Infragistics!!
Thank you for your reply and apologies for the delayed response.
After consulting with our developers regarding this matter it was determined that the behavior is most likely related to a development issue (as your requirement should be achievable by only setting EnableCustomValues to false which currently still allows editing through the delete and backspace buttons). In order to ensure that the matter will receive attention I have logged this behaviors in our internal tracking system with a Development IDs 111865. The next step would be for a developer to research the issues and confirm my findings or offer some resolution.
Your support ticket number regarding this matter is CAS-90055-MJ2XF6 . Please feel free to send us any updates in the meantime. You can view the status of the development issue connected to this case by going to the “My IG” tab on our website, hovering to the "My Support Activity" dropdown and selecting the "Development Issues" tab.
Feel free to contact me if you have any questions.
Thanks for the comeback..
This is working fine, But the items which are being selected are now deselected.. I got an idea here like,
after initialization event, we also need to write inputkeydown event like below as an example
function ddlSerLine_InputKeyDown(sender, eventArgs)
{ var dropdown = $find('<%=ddlSerLine.ClientID %>'); while (dropdown.get_selectedItems().length > 0) { dropdown.get_selectedItems()[0].inactivate(); //dropdown.get_selectedItems()[0].unselect(); } //set some default value in the dropdown's input field dropdown._elements["Input"].value = "-Please Select-"; }
function ddlSerLine_Initialize(sender, eventArgs) { sender._elements["Input"].readOnly = true; }
Once when the dropdown has been initialized, then the input box will be read only, when user tries to press the key then in InputKeyDown event we need to hold the selection, But in the above code, if the items are selected we are deselecting and deactiviting 'em, Instead of that i need to hold the selected values..
I hope you are clear on my issue..
Apologies for the delayed response.
I am unsure of the issue your are describing in your last, however after examining the matter further, in your scenario it may be more convenient to set the input element of the dropdown to be readonly upon initializing the WebDropDown. This may be done using something similar to:
function WebDropDown1_Initialize(sender, eventArgs){ sender._elements["Input"].readOnly = true;}
Hope this is helpful.
Any solution for this?? I just want to disable the INPUT TEXTBOX so that users can not even click on the textbox, But this hsould happen when DisplayMode is in DropDown not for DropDownList..