Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Expand and Maximize a Specific Detail

  • 2 minutes to read

The example below shows how to maximize a detail View.

If the detail View does not exist, we should create it by expanding a specific master row. In our case, we obtain and work with the detail corresponding to the first master row.

After the master row is expanded, the detail View is obtained via GridView.GetDetailView.

Then the detail is maximized using the BaseView.ZoomView method. After that, the detail object and the GridControl.DefaultView property refer to the same maximized detail.

We use GridControl.DefaultView to group detail data rows by the “FUNCTION” column.

    int rowHandle = 0;
    //Create the first detail by expanding a master row
    GridView gView = gridControl1.MainView as GridView;
    gView.SetMasterRowExpanded(rowHandle, true);
    //Get the first detail
    BaseView detail = gView.GetDetailView(rowHandle);
    if (detail != null) {
        detail.ZoomView();
        //Access the detail via DefaultView
        //Group by the FUNCTION column
        (gridControl1.DefaultView as GridView).Columns["FUNCTION"].GroupIndex = 0;
    }