Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Grid Tech Support » Auto complete Collapse All
Subject Author Date
Andrew Hafer Feb 8, 2007 - 9:06 PM

Does elegant grid offer an autocomplete feature? Particularly, can it automatically match the typing into a comboboxcell to the list of values and offer completion suggestions? If not, how can I set the text (and selection) that is being edited so I can implement my own autocomplete?

Thanks.

Technical Support Feb 9, 2007 - 8:58 AM

We have just implemented autocompete as a response to your request. It is available in the updated dll mentioned in the previous post. There are three new members added to ComboBoxCellStyle: AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource. They have the same meaning as those in theSystem.Windows.Forms.ComboBox class. Here is the code snippet that illustrates this technique.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim grdColumn As Column
        Dim dr As DataRow
        Dim tCell As TextCell

        With UnboundGridControl1
            .AllowRowSelection = False

            grdColumn = New Column
            .Columns.Add(grdColumn)

            dr = .NewDataRow
            tCell = dr.AddNewCell(GetType(ComboBoxCell), .Columns(0))
            tCell.DataValue = ""

            Dim style As ComboBoxCellStyle
            style = tCell.Style
            style.AutoCompleteMode = AutoCompleteMode.SuggestAppend
            style.AutoCompleteSource = AutoCompleteSource.CustomSource
            style.AutoCompleteCustomSource = New AutoCompleteStringCollection()
            style.AutoCompleteCustomSource.AddRange(New String() {"One", "Two", "Three"})

            .Rows.Add(dr)
        End With
    End Sub
End Class