Ticket T253031
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Why can a DetailView be not editable or display empty values?

Add/Instantiate NonPersistent Detail View in DashboardView

created 10 years ago

Hi Support Team,

I have a dashbaordview which contains an ascx page and a xaf listview.
Now we want to add fields to filter the listview.
So I created a nonpersistent class (detailview) which contains the fields for filtering and a collection (using the same xaf listview).
Please refer to attached file for the screenshot.

Using the newly added detailview instead of the listview, I noticed that the fields is not editable.
I'm guessing that the NonPersistent object is not yet instantiated when the dashboard is loaded.

Please advise how to make the fields in detailview editable so I can input values to filter the listview.
Other implementation is welcome also.

Respectfully,
Carlo

Answers approved by DevExpress Support

created 10 years ago (modified 10 years ago)

Hello Carlo,

You are right, it is necessary to assign the CurrentObject to this DetailView. If the parameters class is not used anywhere else, you can simply create a controller for this DetailView, as shown below:

C#
public class ViewController1 : ObjectViewController<DetailView, FilterParameters> { protected override void OnActivated() { base.OnActivated(); if (View.CurrentObject == null) { View.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit; View.CurrentObject = new FilterParameters(); } } }

Does this solution meet your needs?

    Show previous comments (1)
    Anatol (DevExpress) 10 years ago

      This is just an example of a non-persistent class. Substitute it with the name of your class whose DetailView you want to show.

      CE CE
      Charlemagne Escarro 10 years ago

        Thanks Anatol for the prompt feedback.
        It's ok now.

        Anatol (DevExpress) 10 years ago

          You are welcome!

          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.