User (Old forums)MemberFebruary 5, 2009 at 10:11 amPost count: 23064I 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)MemberFebruary 6, 2009 at 2:38 pmPost count: 23064User (Old forums)MemberNovember 4, 2009 at 5:19 amPost count: 23064
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.
Imported from legacy forums. Posted by Dexter (had 1019 views)
- You must be logged in to reply to this topic.