Search This Blog

Tuesday, May 30, 2017

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

I would like to promote a Support Center article on the subject, which I heavily updated with new code examples and implementation considerations after receiving a similar customer request yesterday.
As I found later when searching our support database, many users wanted this specific customization in nested ListViews, mainly not to overload end-users with a separate root DetailView in this inner context. I must say that I saw similar reasoning for MasterDetailMode = ListViewAndDetailView too (for this scenario, we offered a solution like this one).


I personally prefer the 2nd solution from this article, but I must admit that both solutions could be simpler, ideally. Please let our team know if you experienced a similar need and clarify exactly where and why as well as how you are solving it now. With that, we will be a better position to consider further improvements. Thanks in advance, guys!


3 comments:

  1. This is really nice! I've always been slightly irked that this wasn't easy to do (or at least there was no documentation on it), since the main reason to use the Inline Edit is to prevent the creation of unnecessary windows sliding in layer after layer after layer. This gets very annoying very fast if the object is simply, with only one or two visible fields.

    What I also think, though, is that it would be amazing if clicking the regular 'New' action would result in an entry dynamically added to the ListView, as if the Inline New action is used. That is because it seems counter intuitive to have a 'new' action on an already existing row. Having the seperate Inline New is also counterintuitive, as most other times you want to create a new object you move towards the action bar. But as I understand this is quite complex, as I have read up on it before.

    ReplyDelete
    Replies
    1. Thanks for your feedback! Our team will take it into account for the future. In the meantime, you can assign a client side script to the New Action in the nested ListView to trigger this process manually by using the client-side ASPxClientGridView.AddNewRow method.Refer to the following documentation for more details:
      http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewScriptsASPxClientGridView_AddNewRowtopic
      https://documentation.devexpress.com/#eXpressAppFramework/DevExpressExpressAppActionsSupportClientScriptsExtensions_SetClientScripttopic

      Delete
  2. I agree with Anonymous that I've always found this annoying as well. If I have an editable listview can't think of any reason I want to have the detailview shown at all. Anyway, I prefer the 2nd solution as well and have implemented in Winforms XAF and it works fine. I'm OK with training users to click in New Row and use down arrow to save (since there is no inline New button in winforms)

    ReplyDelete