Skip to main content
A newer version of this page is available. .

ASPxClientControl.SetWidth(width) Method

Specifies the control’s width in pixels.

Declaration

SetWidth(
    width: number
): void

Parameters

Name Type Description
width number

An integer value that specifies the control’s width, in pixels.

Remarks

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.

Example

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