Divelements SandGrid for Windows Forms 2.2.4 » Developer.Team

Divelements SandGrid for Windows Forms 2.2.4

Divelements SandGrid for Windows Forms 2.2.4
Divelements SandGrid for Windows Forms 2.2.4 | 5 Mb


SandGrid is a powerful, versatile list control capable of displaying data in tabular and hierarchical form. It was designed from the ground up to support trees of items and to be truly extensible. Because of its special architecture it offers a powerful replacement for the ListView, TreeView and DataGridView controls - offering more customization options and a consistent development experience.

Data in a SandGrid control can come from many sources - it operates in both bound and unbound states without compromising on features in either mode of operation. It complies with the standard Windows Forms databinding model and understands data sources from the simple IList to the advanced IBindingListView. It also offers a powerful middle ground between bound and unbound operation with virtual rows, which give you the speed of only having your data in one location without sacrificing the flexibility of presentation.

Sorting and grouping are fundamental to data display and SandGrid fully supports both with an extensible, lightning-fast API. The grid will automatically enable sorting and grouping by any column when populated. When bound to data it will use the data's native sorting methods, and when unbound its own native sorting is used. You can even establish different sorting on different levels of data, when operating as a tree of nodes. Standard single-column as well as advanced multi-column sorting is supported. Grouping is automatically applied to the first level of sort, if enabled.

SandGrid ships with a number of specialized column and cell types for quickly integrating with different types of data. A DateTime column knows how to group date information in a user-friendly manner, and various image columns know how to translate a row of data into an image selection to display. A ProgressBar column can display progress for individual cells. It is easy to add your own columns and cells with their own distinct behavior and look and feel. Columns can be autosized based on their contents, based on the available screen space or set to fixed widths. Of course, the user can change column widths and SandGrid supports a mechanism to quickly serialize the state of any grid - including column widths, visibility, display order and sort state.

The SandGrid architecture is such that every element in the grid receives its own mouse commands and is responsible for its own painting. This design offers tremendous extensibility possibilities, and several features of the library itself take full advantage. A special kind of row allows you to nest another full-featured grid within itself, and of course this can be used recursively to represent trees of data with different schemas. This is best illustrated by binding to a hierarchical data source such as a DataSet with relations. Related views are automatically made available and can be expanded and explored. Nested grids are every bit as powerful as the top-level grid and have their own bindings, display, sorting and selection.

All features summarised here are explained in greater detail further down the page.

Nested grids allow visualization of related data
Hierarchical architecture
Row features
Column features
Pluggable renderers for a choice of visual styles

Easily replaces the ListView, TreeView and DataGridView controls.
Fast sorting (both single and multi-column supported).
Outlook style grouping on the first level of sort.
Full-featured independent nested grids.
Use bound or unbound without sacrificing capabilities.
Printable including Print Preview.
Virtual rows bridge the gap between ease of binding and flexibility of static data.
Supports both row and cell level selection, with configurable highlights.
Optimized text display engine ensures very fast drawing.
Pluggable renderer support for customised drawing of common elements.
Editing support through an extensible editor framework.
Export to HTML function.
Grid lines in horizontal, vertical, or both directions.
Automatic clipboard handling.
Highly customizable and extensible.

Nested Grids

A result of the architecture of this product means it was easy for us to support a row type that contained another full featured grid. We were able to do this by abstracting the concept of a grid from the toplevel control that by default displays one primary grid. This design choice does not come at the expense of ease of use, however - because all properties of the primary grid are duplicated by the SandGrid toplevel control itself, if you never needed to use nested grids you wouldn't know the feature was there.

When binding to advanced data sources such as DataSets and DataViews, SandGrid is able to automatically interrogate the sources to discover information about related views and tables. This is not restricted to DataSets however - any hierarchical data source implementing the appropriate interfaces is supported.

The demonstration application included with SandGrid shows the power of nested grids by populating a DataSet with related data from the Northwind database. You can bind to any view by changing the DataMember property, and its related views are automatically discovered and made available. For instance, when binding to the Employees table one can expand each employee row to reveal a filtered list from the Orders table - orders for that employee. Further expansion of orders reveals further grids containing a list of order items. Each grid has its own selection, sorting, grouping, editing and binding facilities.

Keyboard navigation in and out of nested grids is straightforward and intuitive. One can highlight a nested grid row as you would any other, and move the selection inside it and back out again with the arrow keys. Nested grids are drawn with a soft drop shadow that distinguishes them from their background, and which changes to indicate when they have the focus.

Hierarchical Architecture

Because SandGrid was designed from the ground up to be fully hierarchical in its content, every row supports child rows. This facility for displaying data in a tree is often needed by such applications as newsreaders, for threaded views. Because support is built so deeply into the library, it does not adversely affect the speed of measuring, layout or painting operations, as is the case with competing products.

Nested rows all obey the same schema, that is the main columns in the grid. They are usually indented and have tree lines drawn to show their relationship to each other. Standard expand and collapse buttons are drawn and the usual mouse and keyboard commands work as expected.

SandGrid rows support a ContentsUnknown property for hierarchical data, to be used when it is unknown whether a row contains any children. Upon the first expansion of the row the developer can run code to determine this and populate the row. With other products this is usually achieved by adding a placeholder row as a child of the first, but SandGrid makes this a great deal more elegant. This facility is ideal for Explorer-like applications and is used internally for delayed loading of hierarchical DataViews.

Support for trees of items comes with a useful side effect - the grid can be used as a replacement for the standard TreeView control when set up with a single autosizing column and tree lines and buttons. The advantages to using SandGrid as a replacement for the TreeView are numerous, and include custom sorting (even grouping), custom drawing, different editor types and advanced extensibility.

Row Features

As containers for the actual data being displayed, the rows are the key to data manipulation and layout in SandGrid. They can be bound to items within a bound data source, they can contain cells which contain data, or they can retrieve data from elsewhere.

There are many display enhancements available for rows. Grid lines can be turned on in horizontal, vertical or both directions. Shading can be applied to alternate rows to increase readability for complex data. Tree lines and buttons can be shown when nested rows will be used. When a highlight needs to be drawn for selection, it can be applied to the entire row, a partial row (like ListViews) or to just the contents of the primary column. This variety of styles allows the grid to function like virtually every kind of list control there is.

Rows are, of course, highly extensible. One can write a simple row extension that is designed to convert a business object in to data for display and sorting. Called "Virtual Rows", this feature is shown off in the demonstration application and is a great way to show your data without suffering the loss of flexibility that is sometimes associated with data binding. Virtual rows pull data straight from your application as needed, including images and other row characteristics.

Taking control of the drawing of rows and data is easy. When you subclass a row you can take full control of mouse interaction and painting. The screenshot to the right is taken from the demonstration application, where ownerdrawing has been used to draw a subject line for each message below the normal data.

Row headers can be turned on, and they show glyphs to indicate the current row, edit operations and rows with errors. Clicking and dragging on a row can initiate a multi-select operation or it can reorder rows. Rows can also be resized by dragging their grippers in the same way as columns.

NEW: Sprung column resizing improved; original setting of Width property is now maintained leading to greater precision.
NEW: MinimumWidth property is now respected for sprung columns.
FIX: It was possible with a combination of no live resize, scrolling and hidden columns to drag a column edge such that an exception would be thrown.
FIX: EmptyText was not displayed if rows were present but filtered out.
FIX: Invoking the UpDownEditor by starting to type would fail to relay the first typed character into the editor.


[/b]

[b] Only for V.I.P
Warning! You are not allowed to view this text.
SiteLock