Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 17th, 2007, 10:31 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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



Reply With Quote
  #2 (permalink)  
Old December 17th, 2007, 12:11 PM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


Reply With Quote
  #3 (permalink)  
Old December 17th, 2007, 02:08 PM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old May 9th, 2013, 10:36 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by pencilneck View Post
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
Reply With Quote
  #5 (permalink)  
Old September 18th, 2014, 03:49 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

check this one....C# Autocomplete textbox in Datagridview

Kerry

Quote:
Originally Posted by pencilneck View Post
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
Reply With Quote
  #6 (permalink)  
Old July 21st, 2016, 07:01 AM
andersons
Guest
 
Posts: n/a
Default

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
turn off the autocomplete for form fields surya CSS Cascading Style Sheets 3 September 16th, 2008 12:53 AM
how to use autocomplete feature in listbox? shiva srivastava ASP.NET 1.0 and 1.1 Basics 7 August 20th, 2007 04:05 AM
autocomplete textbox like google nilsan ASP.NET 1.0 and 1.1 Basics 1 February 27th, 2007 06:36 AM
autocomplete textbox like google nilsan ASP.NET 1.0 and 1.1 Professional 0 February 27th, 2007 04:32 AM
autocomplete text field Frosty1 Dreamweaver (all versions) 1 February 12th, 2005 02:43 PM



All times are GMT -4. The time now is 06:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.