Blogs

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:AgDataGrid>
<dxg:AgDataGrid.Columns>
<dxg:AgDataGridColumn FieldName="PartID"/>
<dxg:AgDataGridColumn FieldName="Price"/>
<dxg:AgDataGridColumn FieldName="Quantity"/>
<dxg:AgDataGridColumn FieldName="Total" UnboundExpression="[Price] * [Quantity]"/>
</dxg:AgDataGrid.Columns>
</dxg:AgDataGrid>

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

Silverlight Expression Editor

Cheers,

Azret

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

Comments

No Comments
LIVE CHAT

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 info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

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