Wrox Programmer Forums
| 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 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
  #1 (permalink)  
Old December 17th, 2007, 11: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



  #2 (permalink)  
Old December 17th, 2007, 01: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


  #3 (permalink)  
Old December 17th, 2007, 03: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

  #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
  #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
  #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.


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 07:36 AM
autocomplete textbox like google nilsan ASP.NET 1.0 and 1.1 Professional 0 February 27th, 2007 05:32 AM
autocomplete text field Frosty1 Dreamweaver (all versions) 1 February 12th, 2005 03:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.