cancel
Showing results for 
Search instead for 
Did you mean: 

How to centrelize a container below the root container in wdDoModifyView

Former Member
0 Kudos

Hello,

I am using the wdDoModifyView in order to create dynamic UI.

I am building a table in a container and add this container to the root container.

The table is centralised in the new container.

The problem is that at the result the table is not centralized, that is because the container added to the rot is not.

The layout of the root is Grid Layout, so if I would do this at design time I would set the HAlign property of the container below the root one to be center but I don't see this option in the container API. I assume I will need to play a bit with the layouts in runtime.

Can anyone please supply a piece of code for that?

Thanks,

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Why not just giving the root container a matrix layout and adding the table into the root container directly? Set table.layoutData = MatrixHeadData with hAlign=center.

Armin

Former Member
0 Kudos

Because that container needs to be destroyed next time you run wdModifyView and I can't destroy the root container....

Former Member
0 Kudos

Why do you need to destroy it?

Armin

Former Member
0 Kudos

because I'd like to rebuild it, how does it affect my question? I just like to centrelize one container inside another in runtime....

Former Member
0 Kudos

Well, if you don't like my questions which I'm asking to completely understand the use case and find the best solution, then I am not asking anymore.

Armin

Former Member
0 Kudos

Armin,

I apologize if I've offended you but my question is very simple and has nothing to do with my situation (at least from my point of view): How to centralize one container inside another at run-time?

Roy

Former Member
0 Kudos

I already wrote it:

Container: MatrixLayout

Child: MatrixHeadData, hAlign=center

Armin

Former Member
0 Kudos

And I already wrote: That will centralize the table within the child container but the child container itself will still be at the left of the root container, so the entire table with be at the left.

Former Member
0 Kudos

Wait, I thought you mean mean setting table as MatrixHeadData, hAlign=center.

Setting root container as MatrixLayout and child as MatrixHeadData with hAlign=center did work. Thank you.

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Answered