Solved

.NET DataGridView Combobox not keeping autocomplete value

Posted on 2014-09-22
4
424 Views
Last Modified: 2014-10-27
I have an application that contains a datagridview with several combobox columns.  

There is no issue when the user clicks on the desired entry value, however the autocomplete does work correctly with highlighting the correct entry (i.e. type 'Y' lists 'Yes), when leaving the cell the highlighted value disappears.
0
Comment
Question by:Cmitch
4 Comments
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 40336411
Your explanation is unclear. It will disappear if you don't select the value you desired.
0
 

Author Comment

by:Cmitch
ID: 40336447
Sorry, it will disappear if you only type in the entry.

Whereas if I was to click on a entry this keeps the selected value every time.
0
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 40342087
it is still unclear. please tell each single action you take and explain what is different to the normal behavior of an editable combobox.

note, there are different implementations of an editable combobox which allows to enter new entries in the edit field of the combobox. if the dropdown list opens when you begin typing the autocomplete was not shown in the edit field but only the first match of the string typed so far was displayed in the dropdown list. to overtake the suggestion you would use the arrow keys or the mouse. other implementations would not show the dropdown box while typing but would show the autocomplete suggestion highlighted right to the text cursor.

if you don't want to be able to type new values you should use a non-editable combobox rather than a dropdown edit.
 
Sara
0
 

Expert Comment

by:Sha
ID: 40358516
Hi Cmitch,
I understand, when you type Y it shows YES but when you leave the cell the values disappears. Same time when you click, YES appears but it do not disappear when leave cells.

if this is right, Pls check the selectedIndex value of the combo box while leaving cells. May be you will have to set it based on the displayed text ( if selectedIndex  < 0)

Sha
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question