I have a tab control with three tabs. One of the tabs has an ultragrid on it. I set up the grid column to use UltraDropDown to select items. I want the column to show texts but store number internally. After the form is loaded, I try to switch between tabs. When I select the tab with grid on it, it takes a while for the contents of the grid to load(paint). When there are more rows on the grid, it takes even longer. When I set Visual Studio to show all exceptions, I got the exception "Input string not in correct format". If I setup the DisplayMember and ValueMember to be the same, the grid loads right away without delay. I assume there might be something wrong with my setup and it's slowing it down. I have attached sample code. Not sure if I set up everything correctly.
Thanks,
Jason
That's awesome! Thanks Mike!
This appears to be a problem with your sample. You have an UltraDropDown in the grid. The UltraDropDown has two columns Number and Name. The grid has the same two columns.
So the obvious intent here is for the dropdown to operate on the Number column in the grid and convert the Number in the grid cell into some user-friendly display text. But you are attaching the dropdown to the Name column in the grid. The dropdown's ValueMember is set to the Number column so it ends up trying to match the numbers in the dropdown with the text in the Name field of the grid and this is causing exceptions when trying to convert the strings into numbers.
Basically, the InitializeLayout code for your grid is backwards. It should be like this:
Private Sub UltraGrid1_InitializeLayout(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout 'e.Layout.Bands(0).Columns("Name").ValueList = cmbComponents 'e.Layout.Bands(0).Columns("Name").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate 'e.Layout.Bands(0).Columns("Number").Hidden = True e.Layout.Bands(0).Columns("Number").ValueList = cmbComponents e.Layout.Bands(0).Columns("Number").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate e.Layout.Bands(0).Columns("Name").Hidden = True End Sub
Hello Jason,
I have been spending some time today reviewing your sample. I reproduced the performance issue with the tab control loading the grid. I even placed a standalone grid on the form and it loaded fine. The issue is stemming from the dropdown that your adding to the column. Removing it drastically improves performance.
I have opened a private case for you so that I can link it to an internal development issue. This way you will be notified automatically when the dev issue is updated. The case number is CAS-145350-D3N9C1. You will see it located here: https://ko.infragistics.com/my-account/support-activity
Let me know if you have any questions regarding this matter.