The provided sample project is greatly appreciated. It was very helpful for better understanding of the precise case.
When you add the RadMultiColumnComboBox
at run time, note that it is important to initialize its BindingContext
before data binding. Otherwise, you will notice that the RadMultiColumnComboBox.EditorControl.Rows.Count
will return 0. I made the following modification of the code and it works as expected now.
dtSite = CreateDataSource()
mcbViewEmployeeSite.DataSource = dtSite
compositeFilter.LogicalOperator = FilterLogicalOperator.[
'Filling in the values
dtSite.Rows.Count - 1
)) = ValueWeAreLookingFor
SiteIndex = i
'The mcb doesn't seem to index the DataSource before it becomes visible to the UI
mcbViewEmployeeSite.SelectedIndex = SiteIndex
'Here's the exception!
EmployeeSiteBugFix = SiteIndex
'If we don't change the SelextedIndex immediately and instead we put the value on a public string
'and we change it after the function is executed (and the PageView is now visible on the user), it works.
'So I'm guessing the indexing of the DataSource is done only after the control is visible/drawn
'But even this fix only works once per run for some reason. Pushing the button twice will produce the same exception
'Last thing I've noticed. If before re-pushing the second button, you close the previous page, then the bug doesn't occur
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Dess | Tech Support Engineer, Sr.
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.