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

Hierarchy Gridview - lazy load child\grandchild rows

19 Answers 456 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Curtis
Top achievements
Rank 2
Curtis asked on 27 Jan 2011, 10:14 PM
I am using a gridview that i programmatically load 2 levels at run time. My question is, i want to be able to load the child rows of the 2nd level whenever the 1st level is expanded. i was able to locate the child is expanding and expanded events. But is there a way i can then go on and attach the children of the child row to the datagrid?????

19 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 27 Jan 2011, 11:38 PM
Hello,

There is a way called Load-on-demand using the RowSourceNeeded event. Please review the following documentation which explains load-on-demand.
Hope that helps
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 02:28 PM
Hello,

Did this help? If so please remember to mark as answer
Thanks
Richard
0
Curtis
Top achievements
Rank 2
answered on 01 Feb 2011, 04:16 PM
Yes that is kind of what i need to implement. But the problem i have is the approach i am using to load the first 2 levels. I am putting all my objects in the same collection and using parent\child Ids to load the hierarchy. Whereas in the solution you provided i would be openning a child template? What i am after is kinda like having a treeview structure in the grid.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 01 Feb 2011, 04:29 PM
Hello,

The documentation shows the advised way of creating a lazy loading hierarchy grid. The hierarchy grid can be though of like a tree view and will show a hierarchy of levels much like a tree view.
hope that helps
Richard
0
Curtis
Top achievements
Rank 2
answered on 04 Feb 2011, 02:59 PM
I have been looking at the documentation. I am having a problem when i define the child template on form load. The child in the original 2 level hierarchy is being moved to the 1st level. What i want to do is load the child template underneath the 2nd level. I guess my ? is how do i programmatically define the child template to live underneath the 2nd level?
0
Richard Slade
Top achievements
Rank 2
answered on 04 Feb 2011, 03:07 PM
Hello,

For each template, you can add further templates, and thus build your hierarchy. Please have a look at this documentation. If I have mis-understood your request, please let me know.
thanks
Richard
0
Julian Benkov
Telerik team
answered on 04 Feb 2011, 04:19 PM
Hello Thabani,

Just like Richard said, you can use the documentation for load-on-demand hierarchy mode and add unlimited number of child templates - the RadGridView in this case will work like a treeview control.

Greetings,
Julian Benkov
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
Curtis
Top achievements
Rank 2
answered on 10 Feb 2011, 09:09 PM
I think what i am trying to figure out is how to lazy load a child of a self referencing hierarchy? i am new to telerik and besides trying to figure out this issue the syntax is a bit different too.
0
Richard Slade
Top achievements
Rank 2
answered on 10 Feb 2011, 10:02 PM
Hello,

The nature of a self referencing hierarchy is that the data comes from one single source, so, unless you were to split your datasource into a parent source and child source (in which case it is no longer self referencing) then I think that this wouldn't be a viable option. If you were to split your data into two or more sections, then this would work in the same way as detailed in the documentation that was detailed above.
Hope that helps, but let me know if there's anything else
Regards,
Richard
0
Julian Benkov
Telerik team
answered on 15 Feb 2011, 02:25 PM
Hi Thabani,

Thank you for writing.

The self-reference load-on-demand hierarchy mode is not supported by the current version of RadGridView. This is a good idea and we will implement this new hierarchy provider in one of the next releases. As a solution, you can currently use the suggestions and comments provided by Richard.

All the best,

Julian Benkov
the Telerik team

 

Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
Richard Slade
Top achievements
Rank 2
answered on 15 Feb 2011, 03:58 PM
Hi Julian,

If this gets logged on PITS, then there seems to be another vote for this feature here.
Regards,
Richard
0
Julian Benkov
Telerik team
answered on 18 Feb 2011, 10:05 AM
Hi Richard,

Thank you for your comments and suggestions Richard. I logged this feature request in our PITS here.

Greetings,
Julian Benkov
the Telerik team

0
Curtis
Top achievements
Rank 2
answered on 18 Feb 2011, 06:17 PM
I took your advice  and moved away from self referencing and split the data so i could implement load on demand. Now i have an issue when i try and load the child rows. It seems to have something to do with "input string not in correct format". Is there an issue with having special characters (*, . etc) in string values? If there is what would be the work around as i do need these in my strings?
0
Richard Slade
Top achievements
Rank 2
answered on 18 Feb 2011, 06:29 PM
Hi,

I'm now away from my development environment so am unable to try this out just yet. However, this is not an issue that i'm aware of, nor could I find reference to an issue that described this in the Public Issue Tracking System.

If you change the strings to not include these characters, do you still get the issue?
As soon as I can, i will have a look at this for you, but in the meantime, I'd suggest trying this in a test project to see if you can replicate it.
If you could let me know any result, and I'll get back to you with a sample as soon as I can.
regards,
Richard
0
Curtis
Top achievements
Rank 2
answered on 18 Feb 2011, 06:56 PM
Sorry can you disregard this last issue. The datatype of the columns was not string as i thought i was setting them to decimal.
0
Curtis
Top achievements
Rank 2
answered on 18 Feb 2011, 08:43 PM
I cannot seem to find where i can start a new thread for a new issue so i will just post it here. Is there a way to implement parent child scrolling. I want to be able to scroll through both templates at the same time. And can i align the columns too?
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Feb 2011, 12:31 PM
Hello Thabani,

you can start a new thread by going to the forum that you would like to post in (e.g. Home>Community>Forums>WinForms>GridView), and clicking the new thread button.

If you have a hierarchy grid, then the scroll will naturally scroll the entire view. You can alsign columns by making both the master template columns and the child template columns the same width.

Hope that helps
Richard
0
Curtis
Top achievements
Rank 2
answered on 22 Feb 2011, 04:02 PM
I was able to align the columns in the parent template and the 2 child templates but they all have thier own horizontal scroll bar. Is there a way i can just have one horizontal scoll bar for all the levels in the hierarchy the vertical scoll bar seems to work that way?
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 22 Feb 2011, 04:18 PM
Hello,

As far as I'm aware, the Hscrollbars will show as needed for the child templates and you cannot control the scrolling of the child template from the grid scrollbars.
Regards
Richard
Tags
GridView
Asked by
Curtis
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Curtis
Top achievements
Rank 2
Julian Benkov
Telerik team
Share this question
or