Is it possible to do nested grids with Html.Grid()? like so: nested grid example
I've found a lot of tutorials that use Grid.GetHtml(), however, my boss is insisting I use Html.Grid() for consistency in the project.
If not, does anybody know where the official Microsoft documentation for Html.Grid() can be found. All I can seem to find is the documentation for System.Windows.Controls Grid Class and GridView, not Html.Grid().
You can refer to the document of the GridMVC . I search the internet and also not find nested grid code sample using GridMVC . But in discussion in that document
:
Someone has wrote a code sample to implement nested grid (you can search keywords"nested"):
I looked for an example of nested grid, but couldn't find one. I experimented with it and got it working. I thought I share the code in case some body wants to do the same thing:
LogByOrderNumber() gives me data for the 1st level grid and GetPartsByModelName() gives me data for 2nd level grid. I use RenderValueAs() to render the second grid. You have to put the inner grid in some kind of html tag like div to make it work.
Hope that helps.
Best Regards,
Nan Yu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
That are just objects , you can modify the code to get properties/values based on your requirement .
Best Regards,
Nan Yu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
2 Posts
Nesting a sub grid with Html.Grid()?
Oct 03, 2018 09:18 PM|tixekni|LINK
Is it possible to do nested grids with Html.Grid()? like so: nested grid example
I've found a lot of tutorials that use Grid.GetHtml(), however, my boss is insisting I use Html.Grid() for consistency in the project.
If not, does anybody know where the official Microsoft documentation for Html.Grid() can be found. All I can seem to find is the documentation for System.Windows.Controls Grid Class and GridView, not Html.Grid().
Thanks all.
All-Star
18785 Points
3830 Posts
Microsoft
Re: Nesting a sub grid with Html.Grid()?
Oct 04, 2018 05:57 AM|Nan Yu|LINK
Hi tixekni ,
You can refer to the document of the GridMVC . I search the internet and also not find nested grid code sample using GridMVC . But in discussion in that document :
https://archive.codeplex.com/?p=gridmvc#
Someone has wrote a code sample to implement nested grid (you can search keywords"nested"):
I looked for an example of nested grid, but couldn't find one. I experimented with it and got it working. I thought I share the code in case some body wants to do the same thing:
LogByOrderNumber() gives me data for the 1st level grid and GetPartsByModelName() gives me data for 2nd level grid. I use RenderValueAs() to render the second grid. You have to put the inner grid in some kind of html tag like div to make it work.
Hope that helps.
Best Regards,
Nan Yu
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
2 Posts
Re: Nesting a sub grid with Html.Grid()?
Oct 04, 2018 07:00 PM|tixekni|LINK
Thank you so much Nan.
If I may ask, what is this line doing? What is r and l?
All-Star
18785 Points
3830 Posts
Microsoft
Re: Nesting a sub grid with Html.Grid()?
Oct 05, 2018 08:30 AM|Nan Yu|LINK
Hi tixekni ,
That are just objects , you can modify the code to get properties/values based on your requirement .
Best Regards,
Nan Yu
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.