Avatar of liorim2
liorim2
 asked on

AutoSizeMode or AutosizeColumnsMode properties can't be set

Can anybody help me with understanding why is it that when selecting an option for the AutoSizeMode property of a ComboBox type column in a DataGridView (using the designer, not code), or the DataGridView's AutosizeColumnsMode property (again, not programmatically), when closing the form on which the DataGridView resides, I get the Exception: "DataGridViewComboBoxCell value is not valid".

[TRUST ME. THE VALUE IS VALID!!!]

Only when selecting "NotSet" for the AuitoSizeMode property of the ComboBox column, or "None" for the DataGridView's AutosizeColumnsMode property, It works ok.

Is it a known bug. Or is it that I'm doing something, I can't even think of, wrong?
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
liorim2

8/22/2022 - Mon
Bob Learned

Have you applied SP1?

Bob
liorim2

ASKER
Yes, absolutely. This is not the problem.
Bob Learned

Have you tried the suggestions where you dispose of the form when it is closed?

Bob
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
liorim2

ASKER
Where on earth did you find this blog item??
This is it!
A million thanks.

Lior.

This will become 500 points (just want to hook on to you while I have your attention...), if you will be willing to address another, but related issue I have with the DataGridViewComboBoxColumn column type:
What is the meaning of the AutoComplete property?
I cant seem to utilize the property to what I am thinking it is meant to do: Enable an Auto Completion behavior of the text typed into the text portion of the ComboBox.
Or am I all wrong...?
Bob Learned

It's all about finding the right Google expression ;)

DataGridViewComboBoxColumn.AutoComplete Property
http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.autocomplete.aspx

<Quote>
Gets or sets a value indicating whether cells in the column will match the characters being entered in the cell with one from the possible selections. </Quote>

Bob
liorim2

ASKER
Hello Bob.
Thanks for replying. Sorry I am so slow this time.

This I already know!
My problem is that I don't get the ability to write into the ComboBox, to even initiate an auto-completion task.
The ComboBox is fixed in terms of what its cell displays (it is a DataGridView ComboBox type column).
But still it has a property named AutoComplete. Even if it is set to True, The ComboBox cell is not allowing me any typing to make auto-completion happen...

Lior.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.