With
gridViewChecklistItems.MasterTemplate.Columns
.Add(colChkListItemGroupID)
.Add(colChkListtemGroupName)
End
With
gridViewChecklistItems.MasterTemplate.Templates.Clear()
Dim
itemsTemplate
As
GridViewTemplate =
New
GridViewTemplate
With
itemsTemplate.Columns
.Add(colChklistHeadingID)
.Add(colChklistItemID)
.Add(colChklistItemName)
.Add(colChklistItemNote)
.Add(colChkItemTypeName)
.Add(colChkItemTypeSize)
End
With
itemsTemplate.DataSource = gridListOfItems
gridViewChecklistItems.MasterTemplate.Templates.Add(itemsTemplate)
Dim
itemToGroupRelation
As
GridViewRelation =
New
GridViewRelation(gridViewChecklistItems.MasterTemplate)
With
itemToGroupRelation
.ChildTemplate = itemsTemplate
.RelationName =
"GroupItems"
.ParentColumnNames.Add(
"ChecklistHeadingID"
)
.ChildColumnNames.Add(
"ChecklistHeadingID"
)
End
With
gridViewChecklistItems.Relations.Add(itemToGroupRelation)
Exception during custom sorting 2010 Q2 SP2.
Hi
2010 Q2 SP2.
I have random exception when I want sort in grid.
I do something wrong or there is bug in grid?
In my scenario I do custom sorting:
private
void
radGridView1_CustomSorting(
object
sender, GridViewCustomSortingEventArgs e)
{
if
(e.Column.Name ==
"Size"
)
{
SizeObject size1 = e.CellValue1
as
SizeObject;
SizeObject size2 = e.CellValue2
as
SizeObject;
if
(size1.Size > size2.Size)
{ e.SortResult = 1; }
else
if
(size1.Size < size2.Size)
{ e.SortResult = -1; }
else
{ e.SortResult = 0; }
}
if
(e.Column.SortOrder == RadSortOrder.Descending)
{ e.SortResult *= -1; }
}
}
ArgumentException - Insufficient space in the target location to copy the information.
at System.Collections.Generic.LinkedList`1.CopyTo(T[] array, Int32 index)
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Telerik.WinControls.UI.GridViewSynchronizationService.AnalyzeQueue()
at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI)
at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(GridViewEvent gridEvent, Boolean postUI)
at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridViewTemplate.FireViewChangedEvent(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(DataViewChangedEventArgs e)
at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify)
at Telerik.WinControls.Data.RadDataView`1.RefreshOverride()
at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName)
at Telerik.WinControls.Data.RadCollectionView`1.sortDescriptors_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.Collections.Generic.NotifyCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.WinControls.UI.GridViewSortDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at Telerik.Collections.Generic.NotifyCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
at Telerik.Collections.Generic.NotifyCollection`1.InsertItem(Int32 index, T item)
at Telerik.WinControls.Data.SortDescriptorCollection.InsertItem(Int32 index, SortDescriptor item)
at Telerik.WinControls.UI.GridViewSortDescriptorCollection.InsertItem(Int32 index, SortDescriptor item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Telerik.WinControls.UI.GridViewColumn.Sort(RadSortOrder sortOrder, Boolean multiSortMode)
at Telerik.WinControls.UI.GridHeaderRowBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.UI.RadGridView.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Regards