Skip to main content

ASPxClientControl.SetWidth(width) Method

Specifies the control’s width in pixels.

#Declaration

TypeScript
SetWidth(
    width: number
): void

#Parameters

Name Type Description
width number

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