Back to Devexpress

ASPxClientControl.SetWidth(width) Method

aspnet-js-aspxclientcontrol-dot-setwidth-x28-width-x29.md

latest1.8 KB
Original Source

ASPxClientControl.SetWidth(width) Method

Specifies the control’s width in pixels.

Declaration

ts
SetWidth(
    width: number
): void

Parameters

NameTypeDescription
widthnumber

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 :

aspx
<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

GetWidth

SetHeight(height)

ASPxClientControl Class

ASPxClientControl Members