This is a migrated thread and some comments may be shown as answers.

Self Reference Expansion Crash

2 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 02 Feb 2012, 10:39 AM
I have created a grid view and I am trying to group the items together.  I think maybe this is a bug in the older version (v. 2010.3.10.1215) I am using.   The problem is when I click on the expand button in the grid the winform locks up compltely and I have to end the program.  When I remove the self reference I see the grid is built out properly with reference to my IDs and ParentIDs.  The DataSource of my datagrid is a DataTable that I am building via code.

 

this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId");

Did I do something wrong or is this a known bug?


2 Answers, 1 is accepted

Sort by
0
Aaron
Top achievements
Rank 1
answered on 02 Feb 2012, 06:06 PM
Looks like it is hanging up on Telerik.WinControls.UI.GridViewHierarchyRowInfo according to the profiler trace.  Also hanging on call to Telerik.WinContruls.UI.GridDataCellElement.
Function Name Inclusive Samples % Exclusive Samples %
Telerik.WinControls.UI.SelfReferenceCellLayout.UpdateLinksCore()
92.49 0.00
Telerik.WinControls.UI.GridViewHierarchyRowInfo.get_Level()
91.87 1.85
Telerik.WinControls.UI.GridViewHierarchyRowInfo.get_Parent()
78.70 5.03
Telerik.WinControls.UI.GridViewRowInfo.get_Parent()
43.33 40.86
[clr.dll]
30.33 30.33

I clicked the expand button in the grid and I just waited and waited.  Nothing ever happened and I ran through the debugger to ensure it wasn't any code I wrote (could be missing setting something on the grid).
0
Aaron
Top achievements
Rank 1
answered on 02 Feb 2012, 10:40 PM
As a quick follow up, I have now resolved this and found the root cause.  I had made the assumption that the ID field in the data I was pulling from was an INT but it was actually a STRING to my suprise.  The problem was that my ID table was a STRING and my ParentId table was an INT.  The parent rows would be loaded normally but when I clicked to expand the child rows the application would hang without any error.  This was clearly a type conversion issue and I have resolved this by casting the ID to and INT.  If anybody ever runs into this issue make sure that the same data type is used for the self reference.
Tags
GridView
Asked by
Aaron
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 1
Share this question
or