Ticket T1254296
Visible to All Users

How to hide the New Action from the main menu, but still have it available inline as the New Item Row feature

created 5 months ago (modified 5 months ago)

[DevExpress Support Team: CLONED FROM Q332740: NewObjectViewController - How to hide the New Action from the main menu, but still have it available inline as the New Item Row feature of ListEditor]

Running into the same issue with XAF v24.1.5 in Blazor. The controller shown above removes both the 'New' button as well as the in-line '+' button.

I wish there was an option to set a List View to ONLY edit in-line or only edit in a tab. If it's in-line, show the '+' button, if it's tab, show the 'New' button. Also, setting in-line editing would disable opening a tab when clicking on a row.

It's not a good user experience to have a mixture of those two edit behaviors in one list view. I can see scenarios where the tab makes a lot of sense, but for example for the one below, the user only manipulates two fields (Last Updated On and Last Updated By are set by EF automatically) and showing a new tab for that makes no sense.

Clipboard-File-1.png

Show previous comments (2)

    First thing I noticed is that you are using 24.1.6 while I was on 24.1.5. Will go and update my version to see if that was the issue. Will report back.

      So there were a couple of differences…

      1. I have most of my config in the Model.DesignedDiffs.xafml instead of Model.xafml, so I went and moved the changes in your project also to the Model.DesignedDiffs.xafml file and your project is still working as it should (+ is showing, New Button is not)
      2. I found that the controller that removes the New Button and adds the + back in your solution is the class CustomBlazorController2, so I added that same class to my project, it did remove the New Button but did not add the + back in. When debugging, NewItemRowListViewController is assigned, and the method to set the NewItemRowPosition gets called and sets the property correctly. Yet in your project, that adds the + back in, while in mine it does not.
      3. The class CustomBlazorController in your project just adds a new Action to the grid, that works when added to my project but does not solve the missing + issue.
      4. The GridViewControllerBlazor class didn't seem to do anything in particular, commenting it out in your project did not impact the issue at hand.
      5. I verified that the settings for Delete, Edit, New, Link, Unlink and NewItemRowPosition are the same in your project as they are in mine. AllowEdit="True" AllowLink="False" AllowNew="True" AllowUnlink="False" NewItemRowPosition="Top"
      6. I made the changes so that the Task grid in the Contact Detail View also is set to the settings in line 5 above, and to my frustration, that ALSO worked in your project while that exact same scenario does not work in mine.
      7. I also found that my 'CreatableItems' only had the Audit Event in it while yours had Contact and Task. So I went and added the item in question into that list but that did ALSO not resolve the issue.

      So far I have NOT been able to either fix my project with what was done in yours nor break yours with what I'm doing in mine.

      As a general thing, I wish the grids were setup that if you have inline editing selected, ONLY inline editing was working, i.e. the pen icon, the + icon and clicking on a row just opens the inline editor instead of going to a new tab. And if you have another edit form selected, you have the New button which opens a new tab with the edit form and clicking on a row opens a new tab with the edit form. It certainly would make things much cleaner as you wouldn't need a custom controller to remove buttons and add others back in.

      Andrey K (DevExpress Support) 5 months ago

        Hello,

        So far I have NOT been able to either fix my project with what was done in yours nor break yours with what I'm doing in mine.

        Please continue comparing these project to find out the difference that leads to the issue.

        As a general thing, I wish the grids were setup that if you have inline editing selected, ONLY inline editing was working, i.e. the pen icon, the + icon and clicking on a row just opens the inline editor instead of going to a new tab. And if you have another edit form selected, you have the New button which opens a new tab with the edit form and clicking on a row opens a new tab with the edit form. It certainly would make things much cleaner as you wouldn't need a custom controller to remove buttons and add others back in.

        Thank you for your feedback. We appreciate it.

        Regards,
        Andrey

        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.