I am using the UltraGrid control to bind a DataTabe during runtime.
We are using threading to bind 50 records (rows) at a time to the Grid (for enhancing the performance)
The databinding is done during thread by using the following code –
grdMasterScheduleCourseLayoutNew.DataBindings.Clear()
grdMasterScheduleCourseLayoutNew.SetDataBinding(DirectCast(CacheManager.GetItemFromCache(gstrGetMasterScheduleTeacherLayout), DataTable), "")
After the above line of code I am adding Groups to the Grid and changing the Header Text.
To add the next 50 rows to grid using the following line of code to merge method of DataTable
DirectCast(grdMasterScheduleCourseLayoutNew.DataSource, DataTable).Merge(dtTeacherLayoutTemp)
We have the functionality to change the data. Which will reframe the groups and headers of the grid.
We also tried dynamically adding this UltraGrid on runtime, but have no luck doing so.
Following are the issues which we are facing (Please see the attached file for detailed error description of Erroe 1 and Error 2)
Error 1. See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Infragistics.Shared.SparseArray.ValidateIndex(Int32 index)
at Infragistics.Shared.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback)
at Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.GetItem(Int32 index, Boolean create)
at Infragistics.Win.UltraWinGrid.RowsCollection.get_Item(Int32 index)
at Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtIndex(Int32 index, Boolean includeSpecialRows)
at Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtVisibleIndexOffset(UltraGridRow startAtRow, Int32 visibleIndexOffset, IncludeRowTypes includeRowTypes)
at Infragistics.Win.UltraWinGrid.RowsCollection.GetNextVisibleRow(UltraGridRow row, IncludeRowTypes includeRowTypes)
at Infragistics.Win.UltraWinGrid.RowsCollection.GetNextVisibleRow(UltraGridRow row)
Error 2. See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Win.UltraWinGrid.UltraGridBand.get_BorderStyleRowSelectorResolved()
at Infragistics.Win.UltraWinGrid.RowSelectorUIElementBase.get_BorderStyle()
at Infragistics.Win.UIElement.get_RectInsideBorders()
at Infragistics.Win.HeaderUIElementBase.get_RectInsideBorders()
at Infragistics.Win.UltraWinGrid.RowSelectorUIElementBase.PositionChildElements()
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
Can anybody please help us in this?
The grid is not thread-safe, nor is the DotNet BindingManager. There are several threads here on the forum that go into this in detail.
Work with a dataset bound to a grid on a separate thread - Infragistics Community