stighy
stighy

Reputation: 7170

Ext.net: how to set a width in percent instead pixel?

i would like to set GridPanel width, to 100%. My gridpanel is in a table. I know i can only set gridpanel width in fixed pixel. So my question is: how to set width of panel, gridpanel etc. in percent in ext.net ? Is it possible ? I don't want to "neste" it into a viewport ... Thanks

Upvotes: 3

Views: 14968

Answers (2)

Elham
Elham

Reputation: 101

To set the Width property declaratively to a unit type other than the default of Pixel, you must create a new unit type specific to the unit type you want. For example, to set a control's Width property to a percentage value of 100, you could do the following:

myWebControl.width = Unit.Percentage(100);

Upvotes: 10

a-second-mix
a-second-mix

Reputation: 372

i dont think you can specify values in percentages.

however if you set the value to 'auto' i believe it will automatically fill the space:

Width and Height Fixed values measured in pixels (or, device-independent units that are approximately 1/96 inch). You can set these properties to Auto so that child elements will automatically resize depending on the sizing of the parent panel.

from microsoft

Upvotes: 2

Related Questions