Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13866 |

    I am getting the following error when using the BringIntoView method:
    <B>An attempt was made to update the PaintManager while it is already updating.</B>

    Why am I getting this error and how do I fix it?

    Private Sub dsBuilder() Handles _dsBuilder.DatasetLoaded

    Dim ds As New DataSet
    Dim dtShipmentDetail As DataTable = DatasetFilterDetail(dsShipments, DatasetFilterStr)
    Dim dtShipmentInfo As DataTable = DatasetFilterInfo(dsShipments, dtShipmentDetail)
    ds.Tables.Add(dtShipmentInfo)
    ds.Tables.Add(dtShipmentDetail)
    Dim drl As New DataRelation(“Shipment Details”, ds.Tables(0).Columns(0), _
    ds.Tables(1).Columns(0))
    ds.Relations.Add(drl)
    DatasetBind(ds)
    Me.gridShipments.SelectedRows.Clear()

    Dim xDCell As Xceed.Grid.DataCell
    Dim xdrw As Xceed.Grid.DataRow
    Dim xdc As Xceed.Grid.Column
    For Each xdrw In Me.gridShipments.DataRows
    Dim xdetaildrw As Xceed.Grid.DataRow
    For Each xdetaildrw In xdrw.DetailGrids(0).DataRows
    If g_CurrentShipment <> “” Then
    If xdetaildrw.Cells(1).Value = g_CurrentShipment Then
    Me.gridShipments.SuspendLayout()
    xdetaildrw.BeginEdit()
    xdetaildrw.ParentGroup.Expand()
    xdetaildrw.IsSelected = True
    xdetaildrw.EndEdit()
    Try
    xdetaildrw.BringIntoView()
    Catch

    End Try
    End If
    Me.gridShipments.ResumeLayout()
    End If
    Next
    Next

    For Each xdc In Me.gridShipments.Columns
    xdc.Width = xdc.GetFittedWidth
    Next

    gridShipments.Refresh()

    End Sub

    Imported from legacy forums. Posted by bluffrat (had 2841 views)

    User (Old forums)
    Member
    Post count: 23064

    1. I don’t think you need to call <b>SuspendLayout</b> and <b>ResumeLayout</b> on the GridControl: those methods are only useful on controls that have child-controls, and the GridControl doesn’t.
    2. I don’t think you need to call <b>BeginEdit</b> and <b>EndEdit</b> on the DataRows, if all you do is expand the parent group, and select the row.
    3. Why do you call <b>BringIntoView</b> on each detail-row of each row in the grid? Try moving it outside the For-loops.

    Imported from legacy forums. Posted by Tommy (had 647 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Tommy. That did the trick.

    Imported from legacy forums. Posted by bluffrat (had 3558 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.