 |
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

December 17th, 2007, 11:31 AM
|
Registered User
|
|
Join Date: Oct 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
DataGridView autocomplete
I want to use autocomplete in a texbox or combobox inside a datagridview, but AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource properties are only available in the details combobox, not in the DataGridView.
Does anyone have an idea how to get around this? Maybe some code in the EditingControlShowing event or something?
Thanks in advance.
pencilneck
|

December 17th, 2007, 01:11 PM
|
Registered User
|
|
Join Date: Oct 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here's the code that answers my own question:
(These are unique to my app: aName, qryName, name, Name, LName, Position)
Public Class InputForm
Dim aName As New AutoCompleteStringCollection()
Private Sub InputForm_Load(ByVal . . .
'TODO: This line of code loads data into the NameDataSet.qryName
'My datasource for the custom dropdown
Me.QryNameTableAdapter.Fill(Me.NameDataSet.qryName )
For Each name As NameDataSet.qryNameRow In Me.NameDataSet.qryName
aName.Add(name.LName)
Next
Private Sub PositionDataGridView_EditingControlShowing(ByVal . . .
Dim cbo As ComboBox
If TypeOf e.Control Is ComboBox Then
cbo = e.Control
cbo.DropDownStyle = ComboBoxStyle.DropDown
cbo.AutoCompleteMode = AutoCompleteMode.SuggestAppend
cbo.AutoCompleteSource = AutoCompleteSource.CustomSource
cbo.AutoCompleteCustomSource = aName
End If
pencilneck
|

December 17th, 2007, 03:08 PM
|
Registered User
|
|
Join Date: Oct 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
New problem:
Despite setting DropDownStyle = ComboBoxStyle.DropDown, it does not allow me to enter a value that is not contained in the list. (According to MS documentation, DropDownList limits entry to the list, while DropDown does not.)
Any suggestions?
pencilneck
|

May 9th, 2013, 10:36 AM
|
Registered User
|
|
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by pencilneck
I want to use autocomplete in a texbox or combobox inside a datagridview, but AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource properties are only available in the details combobox, not in the DataGridView.
Does anyone have an idea how to get around this? Maybe some code in the EditingControlShowing event or something?
Thanks in advance.
pencilneck
|
Hi!
You can get the help from following links. I hope it is very useful for developers related to "Autocomplete of Text In Datagridview".
http://www.mindstick.com/Articles/15...lete%20TextBox
http://www.vb-tips.com/DataGridViewAutoComplete.aspx
|

September 18th, 2014, 03:49 AM
|
Registered User
|
|
Join Date: Sep 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
check this one.... C# Autocomplete textbox in Datagridview
Kerry
Quote:
Originally Posted by pencilneck
I want to use autocomplete in a texbox or combobox inside a datagridview, but AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource properties are only available in the details combobox, not in the DataGridView.
Does anyone have an idea how to get around this? Maybe some code in the EditingControlShowing event or something?
Thanks in advance.
pencilneck
|
|

July 21st, 2016, 07:01 AM
|
|
I want to use autocomplete in a texbox or combobox inside a datagridview, but AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource properties are only available in the details combobox, not in the DataGridView.
|
|
 |