Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Ultragrid Red Cross Coming on the UltraGrid
posted

Hi,

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

_OrderGrid.AddDataSource(_orderCollection)

And then we call the Method

_OrderGrid.ModifyGridRowsShown(_header.rdoShowSelectedOnly.Checked)

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

Thanks

Munish