Hi,
I want to display data from a table such a (ID, ParentID, Description) as a hierarchy. What i did is just create a relation ds.Relations.Add("Relation", ds.Tables["MyTable"].Columns["ID"], ds.Tables["MyTable"].Columns["ParentID"], false);
And then use the setdatabinding method.
The result is the freezing of the application on the setdatabinding method.
Am I doing something wrong ??
OK,
My dataset was a little bit more complicated... so i reduced it to the simple example above, but the result is not suitable.
My data are : A, A1(parent = A), A11 (parent = A1), B, CAnd the displayed grid is :A --> A1 --> A11A1-->A11A11BC
And What I would is of course:A-->A1-->A11BC
Check out the WinGrid Performance Guide. Especially the section 4 - Recursion.
I found a workaround with the InitializeRow Event and the Hidden property of rows. So i build successfully my datagrid like I would.
Moreover, I have another problem, I need to link another datatable below my hierarchy with a relation between my self-referencing table and my new table. And on the SetDataBinding method, it freeze.
Any suggestions ?
gvi said:I found a workaround with the InitializeRow Event and the Hidden property of rows. So i build successfully my datagrid like I would.
I'm not sure what you mean by this, but this is not a solution to the issue. Did you read the WinGridPerformance Guide? You need to set the MaxBandDepth on the grid to prevent infinite recursion.
gvi said:Moreover, I have another problem, I need to link another datatable below my hierarchy with a relation between my self-referencing table and my new table. And on the SetDataBinding method, it freeze.
You can't add another band into the grid. The data structure is determined by the data source, so you need to add a new table and a new relation into your DataSet in order to get another band in the grid.
Mike Saltzman"] I found a workaround with the InitializeRow Event and the Hidden property of rows. So i build successfully my datagrid like I would. I'm not sure what you mean by this, but this is not a solution to the issue. Did you read the WinGridPerformance Guide? You need to set the MaxBandDepth on the grid to prevent infinite recursion. [/quote] I set the maxbanddepth to a lower number, and my grid now works fine.Concerning the InitializeRow Event, I use it to hide rows of my self recursing table. As i wrote above, the displayed rows was : A - A1 - A11 A1 - A11A11BC And I want to displayA - A1 - A11BC It's the only way I found... Mike Saltzman"] Moreover, I have another problem, I need to link another datatable below my hierarchy with a relation between my self-referencing table and my new table. And on the SetDataBinding method, it freeze. You can't add another band into the grid. The data structure is determined by the data source, so you need to add a new table and a new relation into your DataSet in order to get another band in the grid. [/quote] Yes that was I did, setting the MaxBandDepth did the trick. Cancel Reply Cancel
[/quote]
I set the maxbanddepth to a lower number, and my grid now works fine.Concerning the InitializeRow Event, I use it to hide rows of my self recursing table. As i wrote above, the displayed rows was :
A - A1 - A11 A1 - A11A11BC
And I want to displayA - A1 - A11BC
It's the only way I found...
Mike Saltzman"] Moreover, I have another problem, I need to link another datatable below my hierarchy with a relation between my self-referencing table and my new table. And on the SetDataBinding method, it freeze. You can't add another band into the grid. The data structure is determined by the data source, so you need to add a new table and a new relation into your DataSet in order to get another band in the grid. [/quote] Yes that was I did, setting the MaxBandDepth did the trick.
Yes that was I did, setting the MaxBandDepth did the trick.