tetxbox with drop down control and auto complete - c#

in my Application i have text box beside it i have drop down control.
when the user clicks on the drop down . a list of items under the drop down control should be shown. but if user type any value in the text box ( like tom, james, peter). if that value is there in the drop down . i should move the cursor to that value.
hope my Question is clear.
Any solution how to solve it would be great
thank you

what are you looking is,
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx
Just check it, Its autocomplete with dropdown

Sounds like you want something like the JQuery autocomplete plugin or if you prefer the ASP.NET AJAX Autocomplete control.
Edit- as you want a Combobox- JQuery has a lot of options for this. Here is one of them "Simple Combo".

Related

How to make a User Control that behaves like a combobox but with an editable textbox

I want to make a Searchbox, so i want to create a User Control, that display a textbox but when typed on will call a dropdown list similar to that of a combobox. ¿is this posible?
the input that you are describing called AutoComplete,
and WPFToolkit suggest easy to use one
https://github.com/dotnetprojects/WpfToolkit

ASP.NET up down scroll dropdownlist

Hi I'm currently making a registration form, and I want the users to select their birthday month, using a dropdownlist. However, I want to make it so that there is both and up and down button for them to select their month (like google's sign up form as seen in the picture below)
I only can make a dropdown list with the down button, but how would I go about if I want an up button so that for e.g when the user is at February they'll press ^ and go back to January?
That is not an ASP.Net control, that is something like Jquery UI Spinner with up-down buttons and arrow key handling,
you can also use this or this
or if they are not appropriate for you then you can change their styles.
Hope will help you.
You can still use jQuery Datepicker. For example, 3 times for each textbox.

How to store ids with selections in AutoComplete AjaxControlToolkit ASP.NET?

I am implementing the Autocomplete textbox from AjaxControlToolkit in ASP.NET. The ServiceMethod allows me to call a function which will populate a string list with which to populate the autocomplete list that will display.
My question is, when I call the database, I would like to store an ID that corresponds with each selection, so that once it is selected by the user, I can easily look it back up in the database. I don't want to display it in parentheses next to the selection (ie. "John Smith (ID1234)", etc.)
Is there a way to do this so that the ID is 'hidden' so to speak within the Autocomplete box, and can be retrieved on selection? Should i use a different autocomplete box to accomplish this? Any help is greatly appreciated. Thanks!
This might answer your question
http://www.aspsnippets.com/Articles/Fetch-multiple-values-as-Key-Value-pair-in-ASP.Net-AJAX-AutoCompleteExtender.aspx

Custom KeyDown Control

I am very new to ASP.NET and this is my first job and I need to perfom good.
I am stuck on this search page where I have two text boxes. One searches by ID which is int, the second by last name. Both the searched populate a grid view. As per the requirement when the user types in last name and clicks search the grid view should populate which I got working. Now if the user stats typing in the ID Search text box the Lastname Search text box should clear as well as the grid view that had gotten populated should be hidden.
I achieved clearing the text box by using
txtSNumberSearch.Attributes["onKeyDown"] = "clearTextBox(this.id)";
txtSNumberSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtLastNameSearch.ClientID));
txtLastNameSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtSNumberSearch.ClientID));
But am not able to clear or hide the grid view on key down in the text box, my boss says I need to create a custom key down event handler. I do not know how to do it. Any help would be appreciated as I really need to perform at this job.
An easy way of hiding the GridView is by simply adding it into a standard div and hiding that.
<div id="divGV">
<asp:GridView>...
</div>
You can hide the div by doing this in javascript:
document.getElementById("divGV").style.display='none';"
You've already got a handler added for txtLastNameSearch, so you could do something like this:
txtLastNameSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').value='';
document.getElementById("divGV").style.display='none';", txtSNumberSearch.ClientID));
Text boxes don't use InnerText. Try using value property. Keydown is just fine I think.
Try this.
txtSNumberSearch.Attributes["onKeyDown"] = "clearTextBox(this.id)";
txtSNumberSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').value='';", txtLastNameSearch.ClientID));
txtLastNameSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').value='';", txtSNumberSearch.ClientID));

Selecting contents of Label Control

I have what I consider to be a pretty unique problem here, and no idea how to implement. From what I've seen, there is no documentation, tutorials, samples and/or articles on this. I've spent weeks researching, with nothing to show.
The problem:
I need the user to be able to select the contents of a Label Control at runtime, and edit it.
If this can be done by extending the existing Label control, great! Or, if this requires a whole new Label Control to be created, fine. So be it.
Using a TextBox is not an option I'm afraid.
Any help at all is greatly appreciated!
Thank you,
jase
If it's just because a look & feel issue you can make a TextBox control look the same as a label would looks like (just guessing since I can't imagine any reason for not using a TextBox).
Could you pop up a window with a text box in it and then have them edit it there, then set the text property of the label based on the edited text box or do you need to edit it in place? You can set the label text at runtime, but for user input you will have to use a text box.

Categories

Resources