The One With

Silverlight Grid - Unbound Columns and Expression Editor – v2010 vol 1

The AgDataGrid in v2010.1 will introduce a new set of features to work with unbound columns. Now, it was possible to do unbound or calculated columns before but the approaches used to accomplish those had limitations.

For example you could add a “calculated field” (a.k.a a Read only property) to your data objects but you loose the flexibility to customize the value at runtime and, you start bloating your data objects with unnecessary logic. You could also override how the value is to be displayed but by doing so, you loose the ability to perform sorting, grouping and filtering on that ”new” display value.

The AgDataGrid in v2010.1 gives you a new CustomUnboundColumnData event where you can set a value for the cell and a new AgDataGridColumn.UnboundExpression where you can specify an expression to calculate the value. For example suppose you have a Parts table with Columns like Part ID, Part Name, Quantity, Price. And you want to display the Total Cost in the grid as Price * Quantity.

<dxg:AgDataGridColumn FieldName="PartID"/>
<dxg:AgDataGridColumn FieldName="Price"/>
<dxg:AgDataGridColumn FieldName="Quantity"/>
<dxg:AgDataGridColumn FieldName="Total" UnboundExpression="[Price] * [Quantity]"/>

The Grid will also have a build-in expression editor so you can let your end-users do it themselves.

Silverlight Expression Editor



Published Apr 09 2010, 04:37 PM by
Bookmark and Share


No Comments

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at or call us at +1 (818) 844-3383


DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, Delphi, HTML5 or iOS & Android development. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2018 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners