View previous topic :: View next topic |
Author |
Message |
medbiller
Joined: 20 Dec 2007 Posts: 39 Location: Arroyo, PR
|
Posted: Sun Feb 14, 2016 9:05 pm Post subject: Cannot show autocomplete in textbox cell editor. |
|
|
I have the following code:
Code: | Private Sub CellEditorTxtResult_SetControlValue(sender As Object, e As Infralution.Controls.VirtualTree.CellEditorSetValueEventArgs) Handles CellEditorTxtResult.SetControlValue
If TypeOf e.Control Is TextBox AndAlso vtResults.SelectedRow IsNot Nothing AndAlso vtResults.SelectedRow.Level = 2 Then
Dim txtCtrl As TextBox = DirectCast(e.Control, TextBox)
With txtCtrl
.Name = "txtResult"
.AutoCompleteMode = AutoCompleteMode.SuggestAppend
.AutoCompleteSource = AutoCompleteSource.CustomSource
.AutoCompleteCustomSource.Add("aaa")
.AutoCompleteCustomSource.Add("bbb")
.AutoCompleteCustomSource.Add("12345")
End With
End If
End Sub
|
The textbox shows up upon editing and text values can be entered and edited but the autocomplete feature is not working.
[/code] _________________ Medical billing & records developer. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Feb 15, 2016 8:40 am Post subject: |
|
|
AutoComplete does not appear to work for TextBoxes if multiline is set to true. Virtual Tree sets multiline true by default. If you change that it should work. Your SetControlValue handler should also set the txtCtrl.Text text value of the control eg
Code: | txtCtrl.Text = e.Value.ToString() |
Otherwise when you edit a cell the edit control will not be initialized with the existing value of the cell. _________________ Infralution Support |
|
Back to top |
|
|
|