Back to Devexpress

ASPxGridViewBehaviorSettings.EnableCustomizationWindow Property

aspnet-devexpress-dot-web-dot-aspxgridviewbehaviorsettings-f0aed9d8.md

latest4.6 KB
Original Source

ASPxGridViewBehaviorSettings.EnableCustomizationWindow Property

Specifies whether the Customization Window is enabled.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public bool EnableCustomizationWindow { get; set; }
vb
<DefaultValue(False)>
Public Property EnableCustomizationWindow As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true to enable the Customization Window; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to EnableCustomizationWindow
ASPxGridView

.SettingsBehavior .EnableCustomizationWindow

| | GridViewProperties |

.SettingsBehavior .EnableCustomizationWindow

|

Remarks

Set the EnableCustomizationWindow property to true to enable the Customization Window (the Column Chooser ). A user can drag a column’s header to the Column Chooser or to the grid’s header to control the column’s visibility within the grid.

Run Demo: ASPxGridView - Column Chooser

Use the following client-side API to control the visibility of the Column Chooser :

ShowCustomizationWindowShows the Column Chooser HideCustomizationWindowHides the Column Chooser IsCustomizationWindowVisibleIndicates whether the Column Chooser is visible

To specify the position and behavior of the Column Chooser , use the CustomizationWindow property.

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="CustomerID"
    ClientInstanceName="clientGrid">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="CustomerID" ReadOnly="True" Visible="false" />
        <dx:GridViewDataTextColumn FieldName="ContactName" VisibleIndex="0" />
        <dx:GridViewDataTextColumn FieldName="CompanyName" VisibleIndex="1" />
        <dx:GridViewDataTextColumn FieldName="Address" Visible="false" />
        <dx:GridViewDataTextColumn FieldName="City" VisibleIndex="2" />
        <dx:GridViewDataTextColumn FieldName="Region" Visible="false" />
        <dx:GridViewDataTextColumn FieldName="Country" VisibleIndex="3" />
        <dx:GridViewDataTextColumn FieldName="Phone" Visible="false" />
    </Columns>
    <SettingsPopup>
        <CustomizationWindow PopupAnimationType="Slide" />
    </SettingsPopup>
    <SettingsBehavior EnableCustomizationWindow="true" />
</dx:ASPxGridView>


<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Column chooser" AutoPostBack="false">
    <ClientSideEvents Click="OnButtonClick" />
</dx:ASPxButton>
js
function OnButtonClick(s, e) {
    if (clientGrid.IsCustomizationWindowVisible())
        clientGrid.HideCustomizationWindow();
    else 
        clientGrid.ShowCustomizationWindow();
}

For mobile devices, we recommend that you use the Customization Dialog. Online Demo: ASPxGridView - Customization Dialog

See Also

ASPxGridViewBehaviorSettings Class

ASPxGridViewBehaviorSettings Members

DevExpress.Web Namespace