The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am receiving a wierd error when removing a GDBG from a parent control (panel). The binding context is changing and throwing an error. Why would the binding contaxt be changing???? To make matters worse, the error is only being thrown on some machines.
Below is a stack track and the error received. Thanks in advance for any help.
Virgil
Line throwing the error:
Me.pnlGrid.Controls.Remove(_Grid)
Error information:
EndItem ID: 20787
EndItem #: qpart1139
EndItem Desc.: Muggles
Error: There is no row at position 0.
Stack Trace
6/27/2005 11:52:18 AM at System.Data.DataView.GetRecord(Int32 recordIndex)
at System.Data.DataView.IsOriginalVersion(Int32 index)
at System.Data.DataRowView.SetColumnValue(DataColumn column, Object value)
at System.Data.DataColumnPropertyDescriptor.SetValue(Object component, Object value)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.CancelEdit()
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.RefreshRows(CurrencyManager bmb)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.Set_ListManager(Object newDataSource, String newDataMember, Boolean force, Boolean forceColumnCreation)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.OnBindingContextChanged(EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.AssignParent(Control value)
at System.Windows.Forms.ControlCollection.Remove(Control value)
at WinCES.EndItemGrid.BindDataGrid(DataSet SourceData, Boolean DisplayAfterBindingIsComplete) in C:\Projects\Lear\WinCES\WinCES\EndItemGrid.vb:line 1385
at WinCES.EndItemGrid.RebuildGrid() in C:\Projects\Lear\WinCES\WinCES\EndItemGrid.vb:line 7673
ADAdministrator Syncfusion Team June 27, 2005 06:09 PM UTC
The bindingcontext is normally inherited from the parent when the control is parented. So, the parent can play a role in bindingcontexts.
One thing you can try is to set the grid.DataSource = null before you remove it from its parent.COntrols collection to see if this takes care of the problem.
VIVirgilJune 27, 2005 08:29 PM UTC
That works. I also had to do the other things normally associated with rebinding the grid to a new datasource (Datamember=null and ResetHierarchyLevels) prior to re-hooking up the datasource.