The RiaGridView control allows displaying data from the data source on a web page
in the form of a table, as well as selecting, sorting and editing them. It is based
on both ASP.NET and Silverlight technologies, by introducing the Silverlight application
into GridView, an ASP.NET component. This allows using the capabilities of the Visual
Studio environment for tuning the settings of the RiaGridView control.
Data Source Binding
As a data source, you can use any control, implementing the System.Collections.IEnumerable
interface. All the data sources, that a standard GridView can work with, will be
allowed for RiaGridView.
Column Fields
After the RiaGridView control is bound to a data source, the component automatically
creates table columns for each of the fields in the same order they are arranged
in the data source. You can also manipulate the display of the columns manually
by defining your own column field collection. The RiaGridView control element supports
six types of columns that allow displaying data as a text, a hyperlink, a checkbox,
an image or a button.
Paging, Sorting and Dragging
The RiaGridView control element allows you to sort data by the column specified
in the sorting field property. The sorting is assigned by left clicking the triangle
in the in the column header. You can speed up the performance of the component,
if you use the automatic paging with fewer records per page. To amend the column
order, you can use the Field editor or simply drag-n-drop them. There will appear
an arrow, pointing a place, where you can put the column.
Selection and Data Manipulation
A user has an option of single or multiple selections of data cells, as well as
editing, inserting and deleting database records. To select a cell, simply left
click it. The selected cell will change color. You can select several cells, by
indicating the selection area with the mouse cursor. If you select a cell from the
first column, all the cells in the row will be selected.
Column Templating
The RiaGridView control lets you bind fields, even if they are related to different
data sources. For that, it uses a special field, where each of the records will
have a value for display, defined by the bound field, and a value for editing, defined
by the main field from the data source, bound to RiaGridView. For editing a record
from a column, there is a drop-down list of data from the bound field. When you
change the selected value, the data in the data source bound to the RiaGridView
control changes accordingly.
The variants of the ProductID field display, depending on the filed type are presented
below. The upper control applies the TemplateField type of display, the lower –
the BoundField.
Before editing
|
After editing
|
The picture also demonstrates the singularities of editing records with the TemplateField.
The cell with the record before and after editing is selected both in the left and
in the right column.
Fixing Columns Pro version only
It is possible in the RiaGridView control to hold columns immovable while horizontal
scrolling. To do that, you need to right-click on the column header and select Fixed
from the drop-down menu. The column will shift to the left and ‘hold’ in its place.
To return a column to its original state, right-click its header and select Not
Fixed from the drop-down menu. It is possible to fix a few columns. The layout of
the fixed columns may be changed by drag-n-dropping their headers.
Data Filtering Pro version only
The RiaGridView control allows you to filter records in the run-time mode. Filtering
data is displaying records, selected in accordance with the filter expression. The
filter expression is a logical expression that consists of conditions, applied to
the filed value.
The current state of the filter is displayed on the panel above the data table.
Here you can delete or disable a filter and edit its parameters.
Creating a filter:
Disabling a filter:
Editing on the panel is done with the drop-down menus of filter expression elements
that allow you to change the filter conditions, filter values and the logical operator.
Changing the filter expression:
You can also change the filter value of the specified filed by selecting an element
from the pull-down menu under the filter icon in the header of the filed. If you
select (All), the condition of selection for this filed will be deleted from the
filter expression and be removed from the panel.
Deleting a condition from the filter expression:
Try to create your own filter right here:
Data Grouping Pro version only
In the RiaGridView control, you can group data by values from several columns. The
keys (the values of the column, by which the grouping is performed) define whether
a record belongs to the group. The records with the same keys are collated into
groups, displayed separately from each other.
Data grouping is performed in the run-time mode. The header cell of the field, by
which the grouping will be performed, is dragged to the group panel above the data
table.
The group cells are displayed in the control with the indication of the group filed,
the group key and the number of records in the group.
A ‘plus’ mark indicated the collapsed state of the group. Right clicking on it will
change the mark to ‘minus’ and display the cells of the nested groups or the records
with the specified keys.
To cancel grouping, right-click the cross in the upper right corner of the group
panel – the cell will be deleted from the panel.
You can also group cells by several fields.
Try gouping the data yourself.
Data Statistics Pro version only
In the RiaGridView control there is an option of displaying data statistics, such
as sum, average, minimal and maximal values for numerical fields. The statistics
are displayed just below the data table in the line, whose cells contain the statistic
information for the corresponding columns. If the data is grouped, the statistic
data line will appear after each group of records.
RiaGridView Styles
You can adjust the parameters of the RiaGridView control appearance by setting its
properties, among which are: the background (gradient or solid), the border color,
and the font parameters.