This is a migrated thread and some comments may be shown as answers.

Not able to select a row anymore

3 Answers 80 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 02 Dec 2019, 09:23 AM

Hello,

I have some issues with the MultiColumn ComboBox (in the following just CB) in Visual Studio, i'll show you some code steps:

 

step 1: init CB

With myCB
 
    .ClearTextOnValidation = True
    .DataBindings.Clear()
    .BestFitColumns()
    .ValueMember = "wpno"
    .DisplayMember = "wpno"
    .DataSource = myDataset.Tables("myTable")
    .AutoFilter = True
    .AutoCompleteMode = AutoCompleteMode.Append
 
    Dim compositeFilter As New CompositeFilterDescriptor()
    Dim selectField1 As New FilterDescriptor("fieldname1", FilterOperator.Contains, "")
    Dim selectField2 As New FilterDescriptor("fieldname2", FilterOperator.Contains, "")
    Dim selectField3 As New FilterDescriptor("fieldname3", FilterOperator.Contains, "")
    compositeFilter.FilterDescriptors.Add(selectField1)
    compositeFilter.FilterDescriptors.Add(selectField2)
    compositeFilter.FilterDescriptors.Add(selectField3)
    compositeFilter.LogicalOperator = FilterLogicalOperator.[Or]
 
    .EditorControl.FilterDescriptors.Clear()
    .EditorControl.FilterDescriptors.Add(compositeFilter)
 
    .ValueMember = "wpno"
    .DisplayMember = "wpno"
    .DataSource = myDataset.Tables("myTable")
 
End With

 

step 2: select an entry via the GUI or via

myCB.SelectedIndex = 2

works fine

 

step 3: open another form to edit some values of the selected entry

Me.Enabled = False
otherForm.Show()

 

step 4: Edit entry in other form, set a flag and return to first form (containing the CB)

updateEntry(updateField, updateValue)
updComboList = True
firstForm.Enabled = True
Me.Close()

 

step 5: reload values for the CB

If updComboList Then
    updateDataset()
    updateCB() 'code from step1
    CB.Enabled = True
    CB.SelectedIndex = 2 'doesn't work
End If

 

From now on, no change of selection via SelectedIndex or even via the GUI is possible! The CB is still responsive in terms of colors while hovering cells, but no selection is made when I click anywhere on the drop-down table of the CB. This table doesn't close again either.

 

Do you have any suggestions? Or is there maybe a bug with this MultiColumn ComboBox?

 

Thanks heaps.

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Dec 2019, 02:13 PM

 

Hello, 

The AutoCompleteMode.Append will show you the records that starts with the entered text. However, the filter descriptors use the FilterOperator.Contains. Hence, you have to decide which of them to use, leave the AutoCompleteMode.Append or leave the filter descriptors with FilterOperator.Contains and set the AutoCompleteMode to Suggest. Thus, RadMultiColumnComboBox will be filtered according to the applied descriptors. 

The SelectedIndex has to be set to an index from the unfiltered collection. If you set it to an index that is currently not visible in the filtered data, you may not obtain the correct selection. That is why a better options is to specify the SelectedValue instead. I have prepared a sample project for your reference. Could you please give a try and see how it would work for your case.

If you are still experiencing any further difficulties, please specify the exact steps how to reproduce the problem. Thus, we would be able to make an adequate analysis for the precise case and assist you further. 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
IT
Top achievements
Rank 1
answered on 02 Dec 2019, 04:42 PM

Dear Dess,

thank you very much for your quick answer and the attached code sample.

I set the AutoCompleteMode to Suggest, but this still led to the same result.

Upon implementing this change on the filter options, I realized that some logic regarding the filters was wrong.

I fixed this and now it seems to work and respond fine!!

Thank you for your help, it definitely helped me to solve this issue :-)

 

As mentioned, I think it works fine now, but I need to do some further testing. If there should be any further problems, I will gladly contact you again.

 

Best regards and thanks again

Ben

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Dec 2019, 09:00 AM
Hello, Ben, 

I am glad that the provided sample project was helpful for you to discover the problematic part of the code. Feel free to test as much time as you need. 

However, I would like to note that that whenever you rebind RadMultiColumnComboBox to a new DataSource collection, make sure that the FilterDescriptors collection is also cleared.

Should you have further questions please let me know.

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MultiColumn ComboBox
Asked by
IT
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
IT
Top achievements
Rank 1
Share this question
or