473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

LimitToList DataGridViewComboBoxColumn

Hi,

I have a DataGridViewComboBoxColumn. This column displays a list of options to the user. It does not allow the user to enter a selection that is not in the list of options.

dropdown style is not a property that can be used in this corner.

Does anyone know how to let user enter a non-existing option?

thanks

Garland
Jul 5 '06 #1
1 2934
neonk
4
DataGrids are always fun to program with. Even a simple ComboBox can end up with heaps of code behind to it make it work as you wish. As you say you can't change the DropDown Style, this is a pity if the one you currently are using isn't sufficient (ListBox), as you must use Combo-style.

You can force appearance to change on the fly by using WinAPI Calls such as SendMessage(cboXXX.hwnd, CB_XXX, True, ByVal 0) and SetWindowsLong.

Also you can force DropDowns to occur by such prosaic means as using SendKeys("{DOWN}") in situations, though not relevant in this case.

What you can do is keep track of your keystrokes with the KeyPress Event (check the key with (Chr$(KeyAscii)), KeyDown etc, and keep a track of the .text, .sellength, and in code add what the user has typed to the Combo Box in code when they eventually hit Enter or Tab.

Neonk.
Jul 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MLH | last post by:
Combo box LimitToList property setting of No does not prevent the MS Access error "The text you enter must match an entry in the list" from popping up. What makes this bad is that the error is not...
1
by: Shawn | last post by:
I am trying to use a DataGridView to display one column of textboxes with a single value from a query and then next to it have a combobox that displays results from another query. What happens is...
3
by: Rain County | last post by:
I am programmatically building and populating a table and then making it the data source for a dataGridView. I want to add a column to the dataGridView which will be a DataGridViewComboBoxColumn. ...
4
by: John | last post by:
Hi, I've been trying to populate a DataGridViewComboBoxColumn with objects. The object is defined as : private struct manufactItem { public string name; public Guid? man_id;
0
by: Simon Tamman | last post by:
How do other people get around having to define the ValueMember in a DataGridViewComboBoxColumn when binding to a list of business objects? I'm currently doing the following, and it feels wrong...
0
by: Ken | last post by:
Hi I have a little application that does datavalidation. It supports dynamically loaded plugins (you drop a dll with a class implementing IValidator<Tin the same dir as the main application)....
1
by: sklett | last post by:
I have a DataGridView bound to a custom business object. The business object has 2 attributes that are FKs to a lookup table (think HairColorID, EyeColorID, etc) For these 2 columns I have...
0
by: ajey | last post by:
hi all! Im doing a windows application (C#), i have a datagridview bound from a Sql database in which i want one column to be ComboBox.I use DataGridViewComboBoxColumn and bind that column value.......
1
by: =?Utf-8?B?RWQgQ29oZW4=?= | last post by:
I have tried to use the DataGridComboBoxColumn object with limited success. What I want to do is to create one new unbound column to be a combo box (so far, this has worked), populate it with items...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.