Hi,
I would like to get the text from a WebDropDown. The text edited by the user. Not the value or the selected value of an item inside a DataSource.
Example: WebDropDown1.Text
I looked at http://forums.infragistics.com/forums/t/60687.aspx post and tried using WebDropDown1.CurrentValue but it is giving me empty string and not the typed text from WebDropDown.
The value which user is typing may not match any data item which is there in datasource but I need it so that I can use %Like% query on the datasource.
Could anyone please provide me any pointers? Thank you.
Hello Ravi,Please take a look at the attached sample which contains a WDD and a label. When a new value in the WDD is selected it makes a postback and sets text of the label the text of the selected item in WDD.
Thanks for the reply Nikifor.
In my use case when user types in WebDropDown that may not match populated values. So suppose I type "enterprise" it can not match any data populated in dropdown so SelectedValue will be null. But still I want to use that typed text for 'like search' on datasource when I postback the page explicitly. Which can help me get n number of rows matching "enterprise" text. Hope this provides more clarification.
Hello Ravi,Please take a look at the modified from me sample. Now you can type “enterprise” inside the WDD and press the Postback button. It checks the current value of the control and sets the label to it. Please let me know if this suggestion works for you?
Hello Ravi,Please let me know if you have any further questions regarding this issue.
Hi Nikifor,
I found the issue. I used EnableAutoFiltering="Server" in my WDD markup. And once I removed it SelectedValue is giving me what has been typed in WDD. If I keep EnableAutoFiltering="Server" in markup CurrentValue gets set to empty string. Could you please focus a little more on this EnableAutoFilering Property. Is it desired behavior?
Thank you.
Hello Ravi,I made tests with IE 9 in IE 7 mode and IE Tester with IE 7. Every one of the tests provided CurrentValue as it is expected. I am attaching the modified based on your latest code snippets code which I used for testing. I am with Windows 7 64bit.
Nikifor,
I tested it in IE7. So if you can test it that it would be great. And Here is my markup where CurrentValue was empty string.
<ig:WebDropDown runat="server" ID="ddSearchText" EnableViewState="true" EnableAutoFiltering="Server" OnPreRender="ddClientCaching_PreRender" EnableCachingOnClient="true" DropDownContainerHeight="300px" AutoSelectOnMatch="false" EnableAutoCompleteFirstMatch="false" AjaxIndicator-Enabled="True" AjaxIndicator-FadeInDuration="5" EnableAnimations="false" EnableAjaxViewState="true" EnableDropDownAsChild="false" DropDownContainerWidth="400px" > </ig:WebDropDown>
If I remove EnableAutoFiltering="Server" , then I get CurrentValue.
Hello Ravi,Thank you for posting the solution you have found in our community. Any other members who have similar issues may benefit from it. Did you have the chance of testing my modified sample? I made a small change in it in the mark up based on your reports:<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" EnableAutoFiltering="Server">
And I tested it in debug mode – current value is always the written in dropdown text. I tested it in FF 10, IE 9 and Chrome latest.