Make a List View Editable
- 2 minutes to read
This lesson explains how to make a List View editable.
The instructions below show how to create new objects of the DemoTask
type directly in the Task List View.
Step-by-Step Instructions
In the MySolution.Module project, open the Model.DesignedDiffs.xafml file in the Model Editor. Navigate to the Views | MySolution.Module.BusinessObjects | DemoTask | DemoTask_ListView node. Set the AllowEdit property of this node to
True
.When the application renders a List View in edit mode, you can create new objects directly in the List View. To add this functionality, set the NewItemRowPosition property to
Top
orBottom
.Run the application and edit one of the Task objects in the List View:
- ASP.NET Core Blazor
-
To show property editors in a grid row, click the Edit button in that row.
To create a new object in this List View, click the New button in the grid header.
- Windows Forms
To create a new object in this List View, click the empty row directly below the grid header.
Tip
- List Views in DataView, ServerView, and InstantFeedbackView data access modes do not support this functionality.
- To enable the edit mode for a List View in code, add the DefaultListViewOptionsAttribute attribute to the
DemoTask
class.