in Our Scenario
When a particular User is Charting data on a grid like one item is selected by the User So we send that data to the Server and second user has also opened the same document where grid and same data is displayed.
So we are Updating the Value passed by the first user into the collection of the second User and again reassigning the Data source for the Second User Grid and calling the method to hide the Empty rows or cells. So that value charted by first user is reflected at second user and that cell or row is disabled.
But when we are charting the Data sometimes RED X is coming on the Grid of the 2nd user and sometimes error is not captured in the Error event handler of the grid.
Index bound of range or You cannot bind the same data source again issue coming and some object reference is not set to instance message is coming
Can You Please Provide the resolution steps how this can be resolved
Please find the Code below that is being called at the 2nd User end
_orderCollection= New List(Of ItemAdapter(Of OrderItem)) Note.Items.ItemscacheLock.EnterReadLock() Try For Each item As Domain.Note.Item In Note.Items If Not item.IsFiltered Then Dim itemAdapter As ItemAdapter(Of OrderItem) = New ItemAdapter(Of OrderItem) itemAdapter .Item = item Me._orderCollection.Add(itemAdapter ) End If Next Finally Note.Items.ItemscacheLock.ExitReadLock() End Try
And then we call the Method
where below code is called
If Me. _OrderGrid.Rows.Count > 0 Then Dim row As UltraGridRow = Nothing For Each row In grdResult.Rows If Not Nothing Is row.ChildBands Then ' Loop throgh each of the child bands. Dim childBand As UltraGridChildBand = Nothing For Each childBand In row.ChildBands Dim i As Integer For i = 0 To childBand.Rows.Count - 1 If filter Then If Not DirectCast(childBand.Rows(i).Cells(0).Value, Boolean) Then childBand.Rows(i).Hidden = True End If Else childBand.Rows(i).Hidden = False End If Next Next End If If Not filter Then row.Hidden = False row.ExpandAll() End If Next End If
Please provide the solution as issue occurring is not frequent and exception is also not captured but error displayed is some time index out of Bound and After that RED X appears
I followed up on this exact same issue today here:https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/119728/display-ultragrid-selected-checkbox-row-only?focus=true