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 Azret Botash (DevExpress)
Bookmark and Share

Comments

No Comments
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.