Bug Report T744356
Visible to All Users

There is no capability to display CommandColumn items in the Adaptive mode if the Adaptive Detail Layout is customized

created 6 years ago

Hi

I was trying to develope a gridview responsive using the code in demo  Adaptive Layout With FormLayout (https://demos.devexpress.com/MVCxGridViewDemos/Adaptivity/AdaptiveLayoutWithFormLayout?device=tablet&rotate=0). It's all working except the fact i would like to add the new, edit and delete button in my adaptive form layout which are missing in the demo and are not displayed in adaptive mode. I assume i need to add the column in settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items  collection to make the command column visible in adaptive layout but i couldn't find any example working. Could you please provide an example of gridview adaptive layout with FormLayout with new, edit and delete button visible in adaptive mode?
Than k you.

Comments (1)
DevExpress Support Team 6 years ago

    Hello Marco,
    We are working on this issue but we don't have an immediate solution right now.
    We will answer you as soon as we can. We appreciate your time.

    Answers approved by DevExpress Support

    created 6 years ago (modified 6 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Additional information:

    In the scope of the fix applied in this thread, we added the following overload of the AdaptiveDetailLayoutProperties.Items.AddCommandItem method with the ColumnName parameter.
    Use this method to add command columns to the Adaptive Detail Layout:

    C#
    //Layout Items configuration settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddCommandItem("CommandColumnEdit"); settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddColumnItem("ProductName"); settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddColumnItem("CategoryID"); settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddColumnItem("QuantityPerUnit"); settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddColumnItem("UnitPrice"); settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddCommandItem("CommandColumnDelete");

    Take special note that it is necessary to specify names for all required command columns to use this method. For example, if you create command columns using the GridViewSettings.Columns.Add  method, then you can specify command columns's names as shown below:

    C#
    // columns definition settings.Columns.Add(new MVCxGridViewCommandColumn() { Name = "CommandColumnEdit", ShowEditButton = true, Visible = true }); settings.Columns.Add(c => { c.FieldName = "ProductName"; //.......................... }); settings.Columns.Add(c => { c.FieldName = "CategoryID"; //.......................... }); settings.Columns.Add(c => { c.FieldName = "QuantityPerUnit"; //.......................... }); settings.Columns.Add(c => { c.FieldName = "UnitPrice"; //.......................... }); settings.Columns.Add(new MVCxGridViewCommandColumn() { Name = "CommandColumnDelete", ShowDeleteButton = true, Visible = true });

    If you enable command columns using the GridViewSettings.CommandColumn parameters, then you can specify a command column name as shown below:

    C#
    settings.CommandColumn.Visible = true; settings.CommandColumn.ShowDeleteButton = true; settings.CommandColumn.ShowEditButton = true; settings.CommandColumn.Name = "CommandColumn";
    C#
    settings.SettingsAdaptivity.AdaptiveDetailLayoutProperties.Items.AddCommandItem("CommandColumn");

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.