I'm currently working on a project that initially used a form to display data in Text Boxes & UltraComboBoxes
I am now trying to convert from using a Form to using an UltraWinGrid in CardView Mode.
My biggest issue for now is replicating all the Filter/Complete behavior I had on the UltraCombo in the new UltraDropDown control for the grid.
In the Form Version I have this in the Form Init routine
With ucb_EMSName .DataSource = _stcodes .ValueMember = "Station" .DisplayMember = "Station" End With
And then the following control init
Private Sub ucb_EMSName_InitializeLayout(sender As Object, e As UltraWinGrid.InitializeLayoutEventArgs) Handles ucb_EMSName.InitializeLayout With ucb_EMSName .DisplayLayout.Bands(0).Columns("Station").Header.VisiblePosition = 0 .DisplayLayout.Bands(0).Columns("Code").Header.VisiblePosition = 1 .AutoCompleteMode = AutoCompleteMode.Suggest .AutoSuggestFilterMode = AutoSuggestFilterMode.Contains .CharacterCasing = CharacterCasing.Upper .DropDownStyle = UltraWinGrid.UltraComboStyle.DropDown End With End Sub
This works fine on the form by automatically filtering the drop down list as the user types in the control.
For the Grid version I have tried to replicate it with the following
In the form init routine
With udd_EMSName .DataSource = _stcodes .ValueMember = "Station" .DisplayMember = "Station" .DisplayLayout.Bands(0).Columns("Station").Header.VisiblePosition = 0 .DisplayLayout.Bands(0).Columns("Code").Header.VisiblePosition = 1 End With With ug.DisplayLayout.Bands(0).Columns("Station") .ValueList = udd_EMSName .AutoCompleteMode = AutoCompleteMode.Suggest .AutoSuggestFilterMode = AutoSuggestFilterMode.Contains .CharacterCasing = CharacterCasing.Upper End With
And the following control init
Private Sub udd_EMSName_InitializeLayout(sender As Object, e As UltraWinGrid.InitializeLayoutEventArgs) Handles udd_EMSName.InitializeLayout With udd_EMSName .DisplayLayout.Bands(0).Columns("Station").Header.VisiblePosition = 0 .DisplayLayout.Bands(0).Columns("Code").Header.VisiblePosition = 1 End With End Sub
This simply gives me a 2 column drop down with no filtering.
I know this should be simple but what am I missing?
Hello n2dfire,
Thank you for contacting Infragistics.
If you move the code manipulating the UltraGrid columns into the UltraGrid.InitializeLayout event handler and move the code manipulating the UltraDropDown columns into the UltraDropDown.InitializeLayout event, does it work as you expect?
Whenever you need to set properties of columns in any of the UltraGrid-based controls, you should do it in the InitializeLayout event.
Dave,
I actually have 5 different dropdowns so I have limited the sample to just one for simplicity.
Here is what I have now.
Private Sub ug_InitializeLayout(sender As Object, e As InitializeLayoutEventArgs) Handles ug.InitializeLayout With ug.DisplayLayout.Bands(0).Columns("Station") .ValueList = udd_EMSName .AutoCompleteMode = AutoCompleteMode.Suggest .AutoSuggestFilterMode = AutoSuggestFilterMode.Contains .CharacterCasing = CharacterCasing.Upper .Style = ColumnStyle.DropDown End With End Sub
Private Sub udd_EMSName_InitializeLayout(sender As Object, e As InitializeLayoutEventArgs) Handles udd_EMSName.InitializeLayout With udd_EMSName .ValueMember = "Station" .DisplayMember = "Station" .DisplayLayout.Bands(0).Columns("Station").Header.VisiblePosition = 0 .DisplayLayout.Bands(0).Columns("Code").Header.VisiblePosition = 1 End With End Sub
The udd datasource property is set in the form init event
What I am seeing now appears as if the following two properties are being ignored
.AutoCompleteMode = AutoCompleteMode.Suggest
This should begin to remove entries from the dropdown list that do not meet the filter criteria based on the user input
.AutoSuggestFilterMode = AutoSuggestFilterMode.Contains
Should pick up any result in the list that contains the matching string of user input regardless of it's position within the result item text.
Ex "AL" would match both "Albert" and "Ball"
What is actually happening is that no list items are being filtered out as the user types and a selection is only made/highlighted when an exact match is reached. Is there some other property I need to set on the column to tell it when to filter the dropdown?
Thanks
Stephen
Hello Stephen,
Thank you for your response.
According to this page in our documentation, assigning an instance of UltraDropDown to the ValueList property of a column disables the autocomplete functionality of the column. Instead, you should assign an instance of UltraCombo to the EditorComponent property of the column.
Thank You Dave,
I was always under the impression that you weren't supposed to (or at least it was not preferred) to use an UltraCombo as an editor control on a grid but rather the UltraDropDown was *the* solution.
I have a few more functionality wrinkles to iron out still, but this get's back the base functionality I was lacking.
Thanks Again.
Steve
Hi Steve,
That's usually the case. But there are a few cases where you need an UltraCombo for certain features, like editor buttons or (in this case) AutoSuggest.