aspnet-js-aspxclientcontrol-dot-setwidth-x28-width-x29.md
Specifies the control’s width in pixels.
SetWidth(
width: number
): void
| Name | Type | Description |
|---|---|---|
| width | number |
The control’s width, in pixels.
|
This method is in effect only for controls whose width can be changed on the client. For instance, this method is not supported by the following controls: ASPxMenu, ASPxUploadControl, ASPxCheckBox, ASPxFilterControl, ASPxHyperLink, ASPxLabel, ASPxRadioButton, ASPxImageSlider and ASPxClientWebChartControl. Calling the SetWidth method for a control that doesn’t support modifying its width on the client does nothing.
Note
The SetWidth method does not support percentage values.
ASPxGridView :
<script type="text/javascript">
function OnGridInit(s, e) {
s.SetWidth(1500);
}
</script>
<dx:ASPxGridView ID="ASPxGridView1" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="ProductID" ...>
<Columns>
...
</Columns>
<ClientSideEvents Init="OnGridInit" />
</dx:ASPxGridView>
See Also