Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

GridListEditor - How to add a custom unbound column to the GridView in ListView to execute a custom business action for a record

$
0
0

This example shows how to add a custom unbound column to the GridControl in ListView. In the example, a button will be shown in this custom column. When a button is clicked, a custom business action will be executed on the selected record. To be more precise, the boolean Active property of the Order business class will be reversed.
To accomplish this task, we will declare a public SimpleBusinessAction method within the Order class. This will allow to reverse the Active property because for demo purposes it won't have a public setter allowing to set this property directly.
To add a custom unbound column to the GridControl, we will create a new column and configure its editor as needed. To learn more about the GridControl's customizations please refer to the XtraGrid's documentation.

Take special note that XAF Web applications support this scenario out-of-the-box. You can make a method within your business class and mark it with the ActionAttribute. Then, XAF will produce an Action column in the List View for your business class. Refer to the documentation for more details.

IMPORTANT NOTES
One of the prerequisites for this particular solution and the DataAccessMode = Server mode is to have a valid IModelMember defined in the Application Model. You can do this via the Model Editor as described in the eXpressApp Framework > Concepts > Business Model Design > Types Info Subsystem > Customize Business Object's Metadata article.

See Also:
How to provide an inline Action shown right within the ListView control row on the Web
Access Grid Control Properties
Assigning Editors to Individual Cells
Repositories and Repository Items
ActionAttribute Class

Question Comments

Added By: Salam at: 11/27/2012 10:31:29 PM    

Hello Devexpress,
                How to apply the same in Web application?

Added By: Apostolis Bekiaris (DevExpress) at: 1/4/2013 4:00:06 PM    

See also this post http://community.devexpress.com/blogs/eaf/archive/2011/09/16/expandframework-supporting-unbound-columns.aspx


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>