Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Object reference exception when calling Clear() method of the datatable bound to a WinTree
posted

Hi,

We have a heterogeneous hierarchical wintree representation, the tree is constructed by binding each to node, the code used for binding is as below,

this.winTree.Nodes.SetDataBinding(dataView, null); - For root binding

treeNode.Nodes.SetDataBinding(dataView, null); - While binding each node in a tree

The binding works perfectly fine, however deleting few nodes and then calling the Clear() method of the datatable results in an "Object reference... " error.

One way to resolve this issue is to the set the deleted treenodes binding to null (this should be done for each deleted node which is tricky because sometimes a delete could happen directly on the datatable) as show below,

ultraTreeNode.Nodes.SetDataBinding(null, null);

We are not sure why the tree should behave in this manner, is this a known issue or is there a generic solution (other than setting the binding to null).  Please provide your views on the same.

The stack trace is as below,

 

1) Exception Information

*********************************************

Exception Type: System.NullReferenceException

Message: Object reference not set to an instance of an object.

Data: System.Collections.ListDictionaryInternal

TargetSite: Infragistics.Win.UltraWinTree.UltraTreeColumnSet GetColumnSet(Infragistics.Win.UltraWinTree.NodeColumnRelationship)

HelpLink: NULL

Source: Infragistics2.Win.UltraWinTree.v10.2

 

StackTrace Information

*********************************************

   at Infragistics.Win.UltraWinTree.UltraTreeNode.GetColumnSet(NodeColumnRelationship relationship)

   at Infragistics.Win.UltraWinTree.UltraTreeNode.get_DisplayColumnSetResolved()

   at Infragistics.Win.UltraWinTree.UltraTreeNode.GetDataColumnFromDisplayColumn(UltraTreeNodeColumn displayColumn, Boolean allowNull)

   at Infragistics.Win.UltraWinTree.UltraTreeNode.GetDataColumnFromDisplayColumn(UltraTreeNodeColumn displayColumn)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.TreeNodesCollectionComparer.CompareHelper(Object x, Object y, UltraTreeColumnSet columnSet, IComparer sortComparer, SortType sort)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.TreeNodesCollectionComparer.System.Collections.IComparer.Compare(Object x, Object y)

   at Infragistics.Win.Utilities.ComparerWrapper`1.Compare(T x, T y)

   at Infragistics.Win.Utilities.SortMergeHelper[T](T[] arr, T[] tmpArr, IComparer`1 comparer, Int32 si, Int32 ei)

   at Infragistics.Win.Utilities.SortMerge(Object[] arr, Object[] tmpArr, IComparer comparer, Int32 si, Int32 ei)

   at Infragistics.Win.Utilities.SortMerge(Object[] arr, Object[] tmpArr, IComparer comparer)

   at Infragistics.Win.Utilities.SortMerge(ArrayList arrayList, IComparer comparer)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.Sort(Boolean checkVersion, Boolean checkSortResolved)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.SortByColumns(Boolean checkVersion)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.VerifySortVersion()

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.GetEnumerator()

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.CacheBoundNodes(Boolean recursive)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.ResetDataBinding()

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.dataList_Reset(ListChangedEventArgs e)

   at Infragistics.Win.UltraWinTree.TreeNodesCollection.dataList_ListChanged(Object sender, ListChangedEventArgs e)

   at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)

   at System.Data.DataView.OnListChanged(ListChangedEventArgs e)

   at System.Data.DataView.IndexListChanged(Object sender, ListChangedEventArgs e)

   at System.Data.DataView.IndexListChangedInternal(ListChangedEventArgs e)

   at System.Data.DataViewListener.IndexListChanged(ListChangedEventArgs e)

   at System.Data.Index.<OnListChanged>b__2(DataViewListener listener, ListChangedEventArgs args, Boolean arg2, Boolean arg3)

   at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3, Action`4 action)

   at System.Data.Index.OnListChanged(ListChangedEventArgs e)

   at System.Data.Index.FireResetEvent()

   at System.Data.Index.Reset()

   at System.Data.DataTable.ResetInternalIndexes(DataColumn column)

   at System.Data.DataTable.Clear(Boolean clearAll)

   at System.Data.DataTable.Clear()

...

...

Thanks,

spm

 

Parents Reply Children
No Data