Home Forums WinForms controls Xceed Grid for WinForms An attempt was made to bring a row into view while the layout is suspended.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16820 |
    I have a BindingList which is bound to by a number of grids (they all have different property descriptors viewing different properties of the same dataset using the ITypedList interface).  When I start my application I instantiate all these grids without showing them in any kind of Form.  Depending on what grid the users wants to see, I programatically show that grid in a new Form.  My problem currently is that when I remove an item from the BindingList whilst some of the grids are not activated (or shown in a form) then I get this error:
     
    System.InvalidOperationException: An attempt was made to bring a row into view while the layout is suspended.
       at Xceed.Grid.PaintManager.BringRowIntoView(Row row)
       at Xceed.Grid.Row.BringIntoView()
       at Xceed.Grid.MasterGrid.EnsureCurrentDataRow(DataRow newCurrentDataRow)
       at Xceed.Grid.MasterGrid.SetCurrentRowToNewDataRow()
       at Xceed.Grid.MasterGrid.DataManager_CurrentDataRowChanged(Object sender, EventArgs e)
       at Xceed.Grid.DataManager.OnCurrentDataRowChanged(EventArgs e)
       at Xceed.Grid.DataManager.SetCurrentDataRow(DataRow value)
       at Xceed.Grid.DataManager.SetNewPosition()
       at Xceed.Grid.DataManager.BindingList_ListChanged(Object sender, ListChangedEventArgs e)
       at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
       at System.ComponentModel.BindingList`1.OnListChanged(ListChangedEventArgs e)
       at System.ComponentModel.BindingList`1.FireListChanged(ListChangedType type, Int32 index)
       at System.ComponentModel.BindingList`1.RemoveItem(Int32 index)
       at System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
     
     My RemoveAt command is at the bottom here and I have marshalled this call onto the GUI thread so no threading issues exist.
    When I show all my forms (about 8 grids in total – again, all bound to the same data source) and run this command, the row disappears and I recieve no error.
     It seems like the Grid is trying to repaint itself even though it is not displayed in a form.
     
    Is there a way around this without me generating my Grids on the fly each time a user requests a new view? Is this behaviour by design or a bug?
     
    Thanks 

    Imported from legacy forums. Posted by James (had 2906 views)

    User (Old forums)
    Member
    Post count: 23064

    We do not reproduce this here.  If you have a sample application reproducing the issue, and you are entitle to support, you can send it to us at support@xceed.com.

     

    Imported from legacy forums. Posted by André (had 1866 views)

    User (Old forums)
    Member
    Post count: 23064

    André,

     I also encountered this behavior of the xceed grid control. When it’s data-bound to a bindingsource component, and then you set the grid’s visible property to false, with the bindingsource at the first item, when you delete the item, you encounter this strange error for the hidden grid.

    Thanks,

     

    Dexter

     

    Imported from legacy forums. Posted by Dexter (had 1019 views)

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