Exploring Cool Features of Devexpress' ASPxGridView, Page 6
Figure 9: Drop the column header in the group panel and the grid is sorted.
You can drag multiple column headers to the group panel to create sub-groups. Drag the column headers from the group panel back to the grid to un-group, and you can sort by clicking on column headers in the group panel. (That might take you a while to implement from scratch.)
Using the New ASPxGridView Filter Feature
Another cool feature is the new filter feature. The new filter feature shows up as a link at the bottom of the grid when enabled and pops up a dialog that lets you pick options based on the intuitive operators, field names from the data's schema, and even shows the "correct" user control based on the field's data type. To enable the Create Filter link shown in Figure 10, select the ASPxGridView at design time, show the Properties window, expand the Settings property, and set Show Filter Bar to True.
Figure 10: The new filter feature shows up as a link at the bottom of the grid; click the link to display a user-friendly modal dialog.
To change the filter, click on the Create Filter link (see Figure 11). Click the And link to change the operator between clauses. Click the (+) button to add filter options. When you add a filter, the first link is a field, the second is an operator, the last link becomes a dynamic control that facilitates input for the field's data type. To remove a clause, click the cancel button (x) to remove any filter clause. Figure 11 shows a filter on the Discontinued column.
Figure 11: A single filter on the Discontinued column; the result set will show only discontinued items.
After you create a filter, the text of the filter will appear in the link at the bottom of the grid. The link will include a preceding checkbox. Uncheck the checkbox to immediately disable and the filter and re-check to the checkbox to re-enable the filter. Clicking the filter will re-open the filter builder dialog.
You probably won't be surprised that the ASPxGridView supports a lot of other features, such as grid nesting. A lot of time and energy has gone into making the ASPxGirdView pop with features. (There are enough features in this one control to support a couple chapters in a book; someone ought to tackle that.)
I delivered the bits and technical information to you straight, but I think you will enjoy playing with the grid and adopting it for your web solutions enough that you won't have missed some of my usual banter. If you really want to have fun, see if you can make your own grid control do just one of sorting, grouping, or filtering. If you want to get work done, the ASPxGridView from Devexpress is for you.
About the Author
Paul Kimmel is a freelance writer for Developer.com and CodeGuru.com. He is the founder of Software Conceptions, Inc, found in 1990. Paul Kimmel is architect for EDS, an HP Company. You may contact him about article questions at email@example.com.
Check out Paul's most recent books, LINQ Unleashed and Teach Yourself the ADO.NET Entity Framework in 24 Hours (coming Spring 2009).
Copyright © 2008 by Paul T. Kimmel. All Rights Reserved.
Page 6 of 6