PDA

View Full Version : [CLOSED] LAYOUT: Render CodeBehind in <ViewPort> <Items>



atroul
Jan 17, 2017, 4:03 PM
Hello,
I want to add a Multilevel GridPanel in my program but in the examples is implemented only in CodeBehind.
How I can place it in MarkUp in <ViewPort><Items> west region for example?

fabricio.murta
Jan 17, 2017, 9:02 PM
Hello @atroul!

I believe you are talking about this MultiLevel GridPanel example (http://examples4.ext.net/#/GridPanel/RowExpander/MultiLevel_GridPanel/), right?

You can just explore the other RowExpander component samples and I'm sure you'll see how you can do this. Probably the best example would be this one: RowExpander Plugin with FormPanel Detail (http://examples4.ext.net/#/GridPanel/RowExpander/Shared_Component/).

There, you have each row of the grid expandable to a form with some fields. Instead of that, you'll just make the component another grid and, for that sub-grid, will then be applied the RowExpander plugin again with the "sub-subgrid" just like the outer one.

There's no catch about adding the outer gridPanel to a viewport Just add it to the <Items> block of the ViewPort. Notice talking about region means you attached to the viewport the Border layout!

I hope this helps!

atroul
Jan 18, 2017, 2:41 PM
Hello Fabricio,
thank you! I built what I wanted using your instructions. My only issue is that
like in the "Shared Component" example the inner grid is in the right side and not under the first column (Company).
How I can move it there? Because in my program I have only one column in the outer grid. And if use only one column
I can't see the inner grid.
See the photo for better understanding of what I want to achieve:
24819

fabricio.murta
Jan 18, 2017, 8:19 PM
Hello! I was afraid you would notice that! :)

This is a bug. I've just tested it with to-be-released Ext.NET 4.2. It's been fixed for some time. We'll be releasing it in the next weeks but you already can benefit from Ext.NET 4.2 fixes if you pull it from GitHub. You should have received instructions on accessing the code in the Ext.NET purchase emails. If you don't have access to GitHub, please request it emailing support@ext.net.

Well, or wait a couple weeks for Ext.NET 4.2 to be publicly released to NuGet and just update the packages.

But if you can't wait any longer, add this CSS style rule to your page:



.x-grid-row-expander-spacer {
display: none
}


And remember to remove it as soon as you upgrade Ext.NET (although leaving it may not really break anything).

atroul
Jan 19, 2017, 2:57 PM
Hello Fabricio,
ok thank you! I used the css and its working!
I want to add a different subgrid for each expandable row in the outer grid, is it possible or
should I hide inner grid's rows based on a hidden value?
Can you provide me an example?

this is what I want:
(Categories OuterGrid, Items InnerGrid(s))
Category1
item1
item2
Category2
item3
item4

fabricio.murta
Jan 19, 2017, 11:14 PM
Hello! I am glad you could make it work!

But I think your follow-up leads us to a new question, doesn't it? Would you mind if we opened a new thread for that question? Please provide the sample test case with what you tried and is not working so we can advice you based on that.