Skip to main content

ASPxClientControlBase.SetVisible(visible) Method

Specifies whether a control is displayed.

Declaration

SetVisible(
    visible: boolean
): void

Parameters

Name Type Description
visible boolean

true to make a control visible; false to make it hidden.

Remarks

Use the SetVisible method to dynamically define an object’s visible state on the client. The object’s original visibility can be defined by using the object’s ClientVisible property.

Note

If an object’s server Visible property is set to false, this object is not rendered into the web page at all, so it can’t be manipulated on the client side.

Example

The following example illustrates how to use the SetVisible method.

<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" Width="30%" ClientInstanceName="fl" ClientVisible="false">
    <Items>
        <dx:LayoutItem Caption="Layout Item1" ColSpan="1" ShowCaption="True">
            <LayoutItemNestedControlCollection>
                <dx:LayoutItemNestedControlContainer runat="server">
                </dx:LayoutItemNestedControlContainer>
            </LayoutItemNestedControlCollection>
        </dx:LayoutItem>
        <dx:LayoutItem Caption="Layout Item2" ColSpan="1" ShowCaption="True">
            <LayoutItemNestedControlCollection>
                <dx:LayoutItemNestedControlContainer runat="server">
                </dx:LayoutItemNestedControlContainer>
            </LayoutItemNestedControlCollection>
        </dx:LayoutItem>
    </Items>
</dx:ASPxFormLayout>

<br />
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="ASPxButton" AutoPostBack="False">
    <ClientSideEvents Click="function(s, e) {
        fl.SetVisible(!fl.GetVisible());
    }" />
</dx:ASPxButton>
See Also