Hello,
So I've come across this weird (possible) bug whereupon if you bing a datatable as datasource in a multicolumn combobox and then try to change the SelectedIndex before the combobox has been drawn to the UI, you get an Index out of range exception even though the index is perfectly fine.
If you wait for it to be drawn, then it works fine.
I've created a reproducible example where I have a form with a PageView control; there's an "Employee" class whose "NewPage(AvoidBug As Boolean)" function returns a PageViewPage which has a MultiColumn cb inside with a datatable as its DataSource.
The 1st button on the main form will add the PageViewPage control that the NewPage(False) function returned to the PageView and the mccb.SelectedIndex will be changed inside the NewPage() function (so before it's drawn to the UI)
The 2nd button will do the same, only calling the NewPage(True) will result in a Public Variable inside the Class being set to the Index we want the mccb.SelectedIndex to be changed to, but the mccb.SelectedIndex will NOT change. After the control is added on the main form, the mccb.SelectedIndex now changes, and no exception is produced.
*So does that mean the the DataSource indexing on a mbcb occurs only after the control is drawn/visible to the user?
*Another thing I noticed, even when the second button is pushed, the bug avoidance only works once. If you push it again (to add a second PageViewPage) then exception occurs again
*However, if you delete the first PageViewPage before pushing the second button a second time, essentially adding a first PageViewPage again, then the exception doesn't occur
Things will become much clearer by using the reproducible code: https://www.dropbox.com/s/4ccjr37n60mavt4/TelerikWinFormsApp1%20%282%29.rar?dl=1
Best regards,
Ioannis Mamalikidis