I have following exception of casting type in the grid when I bound collection of following objects to the grid
public class DataItem
{
//public ICollection
Attributes { get; private set; }
public IDictionary Reference { get; private set; }
public string Name { get; private set; }
}
Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'System.Collections.IList'.
at Syncfusion.Grouping.Table.InitUnsortedRecords(Boolean forceParentElement)
at Syncfusion.Grouping.Table.CategorizeElements()
at Syncfusion.Grouping.Table.OnEnsureInitialized(Object sender)
at Syncfusion.Grouping.Element.EnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Table.BaseEnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Table.EnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Record.AdjustRecordRowCount()
at Syncfusion.Grouping.Record.GetVisibleCount()
at Syncfusion.Grouping.Record.GetCounter()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterEntry.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounter.GetCounterTotal()
at Syncfusion.Grouping.Internals.ElementTreeTable.get_VisibleCount()
at Syncfusion.Grouping.DetailsSection.GetVisibleCount()
at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupExtend.OnInitializeVisibleCounters(Group owner, GridGroupOptionsStyleInfo go)
at Syncfusion.Windows.Forms.Grid.Grouping.GridChildTable.OnInitializeVisibleCounters()
at Syncfusion.Grouping.Group.InitVisibleCounters()
at Syncfusion.Grouping.Group.GetVisibleCount()
at Syncfusion.Grouping.NestedTable.GetVisibleCount()
at Syncfusion.Grouping.Element.GetCounter()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterEntry.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterBranch.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounter.GetCounterTotal()
at Syncfusion.Grouping.Internals.ElementTreeTable.get_ElementCount()
at Syncfusion.Grouping.RecordNestedTablesPart.GetElementCount()
at Syncfusion.Grouping.Element.GetCounter()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterEntry.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterBranch.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounterBranch.GetCounterTotal()
at Syncfusion.Collections.BinaryTree.TreeTableWithCounter.GetCounterTotal()
at Syncfusion.Grouping.Internals.ElementTreeTable.GetCounterTotal()
at Syncfusion.Grouping.Internals.ElementHelper.GetNextElementStepIn(Element el, Int32 cookie, Type finalType, Boolean stepInNestedTables, Table outerTable)
at Syncfusion.Grouping.Internals.ElementHelper.GetNextElementStepIn(Element el, Int32 cookie, Type finalType, Boolean stepInNestedTables, Table outerTable)
at Syncfusion.Grouping.RuntimeElementsInTableCollectionEnumerator.MoveNext()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.InternalGetFrozenRows()
at Syncfusion.Windows.Forms.Grid.GridControlBase.GetVisibleFrozenRows()
at Syncfusion.Windows.Forms.Grid.GridControlBase._GetClientRow(Int32 rowIndex, Int32 vScrollPos)
at Syncfusion.Windows.Forms.Grid.GridControlBase.GetClientRow(Int32 rowIndex)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize()
at Syncfusion.Windows.Forms.Grid.GridControlBase.IsVisibleCell(Int32 rowIndex, Int32 colIndex)
at Syncfusion.Windows.Forms.Grid.GridControlBase.InvalidateRange(GridRangeInfo range, GridRangeOptions options)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Refresh()
at Syncfusion.Windows.Forms.Grid.GridControlBase.Refresh(Boolean fromModel)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.Refresh(Boolean fromModel)
at Syncfusion.Windows.Forms.Grid.GridControlBase.Refresh()
at OpsCenter.UI.Editor.Grid.AsbtractGridController.OnCurrentCellActivating(GridCurrentCellActivatingEventArgs e) in C:\Projects\Petris\Chinook\OpsCenter\v5\Trunk\OpsCenter.UI\Editor\Grid\AsbtractGridController.cs:line 356