The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientGridView.GetColumnLayout Method

Returns an object specifying the grid column's layout.

Declaration

GetColumnLayout(): any

Returns

Type Description
any

An object specifying the grid column's layout.

Remarks

To set the grid column's layout, use the ASPxClientGridView.SetColumnLayout method.

Note

The GetColumnLayout method works only if the ASPxGridViewBehaviorSettings.ProcessColumnMoveOnClient property is set to true.

Examples

The following example illustrates how to get and restore a column's state on the client side.

The ASPxClientGridView.GetColumnLayout is used to get a column's state.


var initialColumnLayout = null;
function Grid_Init(s, e) {
    initialColumnLayout = s.GetColumnLayout();
}

It returns an object that provides the following fields:

  • column field - Provides all the column's information.
  • visibleIndex field - Provides the column's visible index.
  • parentColumn field - Provides the parent column's information. This field is null if you don't use the banded columns.

{ “column”: ASPxClientGridViewColumn, “visibleIndex”: -1, “parentColumn”: ASPxClientGridViewColumn },

To restore the layout, use the client-side ASPxClientGridView.SetColumnLayout method and pass the previously obtained or customized layout.


function RestoreColumnLayout() {
    grid.SetColumnLayout(initialColumnLayout);
}

Result code:

function click() {
    RestoreColumnLayout();
}
var initialColumnLayout = null;
function Grid_Init(s, e) {
    initialColumnLayout = s.GetColumnLayout();
}
function RestoreColumnLayout() {
    grid.SetColumnLayout(initialColumnLayout);
}
See Also