Showing posts with label RadGridView. Show all posts
Showing posts with label RadGridView. Show all posts

RadGridView Logical vs. Visual Grid Structure

The grid can be thought of in terms of both logical and visual. The logical layer allows you to traverse grid meta data and data, i.e. templates, groups, columns, rows and cells. The visual aspect of the grid deals with the Telerik Presentation Foundation (TPF) elements that are drawn on the screen. RadGridView events such as CellFormatting allow you to manipulate the visual aspect of the grid.

Logical Grid Structure
RadGridView has a logical structure that uses collections of objects such as GridViewRowInfo and GridViewCellinfo to represent elements of the grid. The outline below shows the general structure of the logical layer:

GridViewTemplate (MasterGridViewTemplate)
- RootGroup (RootGroups)
   - Rows (GridViewRowInfo)
   - Groups (DataGroup)
- Columns (GridViewColumn, GridViewDataColumn)
- Rows (GridViewRowInfo)
- ChildGridViewTemplates (ChildGridViewTemplates[])

Where hierarchical data is shown in the grid, the structure changes slightly:

GridViewTemplate
- RootGroup (contains many root groups - one for each row of the parent template)
   - Rows
   - Groups
- Columns
- Rows


This logical tree structure allows you to traverse down through the cell level using RadGridView collections. For example, to traverse starting at the MasterGridViewTemplate rows and through every cell to perform some arbitrary operation:

[C# ] Traversing Rows and Cells
foreach (GridViewRowInfo rowInfo in radGridView1.MasterGridViewTemplate.Rows)
{
foreach (GridViewCellInfo cellInfo in rowInfo.Cells)
{
cellInfo.Value = "Test";
}
} 
 
[VB] Traversing Rows and Cells
For Each rowInfo As GridViewRowInfo In radGridView1.MasterGridViewTemplate.Rows
For Each cellInfo As GridViewCellInfo In rowInfo.Cells
cellInfo.Value = "Test"
Next
Next

...or to iterate all the columns of each child template within the master template:

[C#] Traversing Templates and Columns
foreach (GridViewTemplate childTemplate in radGridView1.MasterGridViewTemplate.ChildGridViewTemplates)
{
foreach (GridViewColumn column in childTemplate.Columns)
{
column.HeaderTextAlignment = ContentAlignment.TopCenter;
}
}

[VB] Traversing Templates and Columns
For Each childTemplate As GridViewTemplate In radGridView1.MasterGridViewTemplate.ChildGridViewTemplates
For Each column As GridViewColumn In childTemplate.Columns
column.HeaderTextAlignment = ContentAlignment.TopCenter
Next
Next



Visual Grid
RadGridView uses virtualization for its visual elements. This means that only the rows that are currently visible have a visual element. When the grid is scrolled up and down the visual elements are reused. For example, because of the virtualization, the CellElement can only be used inside the CellFormatting event and only for the current cell. The CellFormatting event is fired every time when the cell's visual state needs to be updated.

RadGridView has several events that allow you to access the visual elements of the grid: CreateCell, CellPaint, RowPaint, CellFormatting and RowFormatting. These events pass references to TPF elements that represent rows and cells. For example, the abbreviated example below adds a RadProgressBarElement to cell elements in the grid (see Adding Custom Elements to Cells for the full example).

[C#] Handling the CellFormatting Event
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
RadProgressBarElement element = new RadProgressBarElement();
e.CellElement.Children.Add(element);
}

[VB] Handling the CellFormatting Event
Private Sub radGridView1_CellFormatting(ByVal sender As Object, ByVal e As CellFormattingEventArgs)
Dim element As New RadProgressBarElement()
e.CellElement.Children.Add(element)
End Sub

? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadGridView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help

Overview of RadGridView Structure

Row
Each row in RadGridView is represented by GridRowElement class.

HeaderRow
The header element is represented by GridHeaderRowElement class.

Add New Row
Depending on the value of GridViewTemplate.AddNewRowPosition property, the new row element appears below the header row or after the data rows.

FilteringRow
FilteringRow appears automatically when you have Filtering enabled by setting RadGridView.EnableFiltering or GridViewTemplate.EnableFiltering properties.

GridViewIndentColumn
This column appears when the grid data is grouped or there is a hierarchical structure to facilitate the expand/collapse functionality. The expand column is always placed in front of all other grid content columns and cannot be moved.

GridViewDataColumn
Displays a column bound to a field in a data source.

MasterViewTemplate
MasterViewTemplate is the top most GridViewTemplate in the hierarchical structure. It contains all inner GridViewTemplates(GridViewTemplate.ChildGridViewTemplates collection). When there is no hierarchical structure, only MasterGridViewTemplate is displayed.

GridViewTemplate
GridViewTemplate is a basic class containing settings for a single level of the hierarchical structure.

ScrollBars
RadGrid will automatically show and hide scrollbars as needed.

GroupPanel
When you want to enable the group-by functionality for the end-user, you need to set RadGridView.GroupingEnabled to true and GridViewTemplate.EnableGrouping. If you want to prevent the end-user to drag column header into the GroupPanel, set GridViewTemplate.AllowDragToGroup to false. RadGridView.ShowGroupPanel shows/hides the group panel. You can access the group panel using RadGridView.GridElement.HeaderElement.GroupPanel property.
 
? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadGridView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help

Telerik RadGridView Key Features

RadGridView is a grid component developed on top of Telerik Presentation Framework which provides a combination of performance, extensibility, customizability, and ease of use.


RadGridView Key Features
1. Hierarchical data presentation - RadGridView has the ability to represent hierarchical master-detail data. Its hierarchical schema could be set up either at design-time, at runtime using the control API, or handled automatically for you based on the structure of the data.

Easily customizable theming mechanism - RadGridView is shipped with a consistent set of themes that allow you to easily build slick interfaces. Or you can use the codeless visual approach to build a new custom theme.


2. Grouping - RadGridView allows easy implementation of multilevel grouping of data from a single table. Simply drag the column header(s) to the group panel on the top to define the grouping order and hierarchy. You can also programmatically group data using group-by expressions. Another unique feature is the ability to sort grouped data by single or multiple columns. Grouping programmatically also allows you to perform aggregate operations (e.g. sum, min, max, count, first and last) and to output custom formatted strings into the group heading.


3. Multi-column sorting - in addition to the simple one-column sorting RadGridView allows you to sort data by several columns just like in Microsoft Excel. With the help of sorting expressions, you can also do custom sorting.


4. Filtering - RadGridView can perform filtering operations for all columns that support filtering. For each column there will be a dropdown menu with the available filter expressions.


5. Column resizing - RadGridView supports convenient column and row resizing providing the following key features:
� real-time resizing
� best fit sizing
� resizing of the grid on column/row resizing
� clipping of the cell content on column resizing


6. Column reordering with drag-and-drop - column reordering is a nice interface feature which lets users reorder columns, based on their personal preference. Telerik RadGridView allows users to quickly reorder columns at Run Time by simply draging and dropping their headers, with a visual indication of the header being dragged.


7. Keyboard navigation - RadGridView can be navigated using the keyboard. You can focus on a grid with the TAB key, navigate through the rows, and edit cells.


8. Rich set of column types - RadGridView supports the most commonly used column types to provide editing functionality.


9. Pinned rows and Pinned columns support - RadGridView enhances the simple scrolling by supporting pinned rows and columns. You can scroll the grid data, while pinned rows stay visible and next to header row; pinned columns stay visible and on the left of the grid. Ability to use other Telerik elements as editors - This feature gives you extra flexibility in building functionality into applications and allows you to add new custom editors (RadComboBoxElement, RadTextBoxElement, RadButtonElement, RadProgressBarElement, etc).


10. DataBinding to business objects, nullable objects and properties of sub-objects � You can use a wide variety of data-sources for grid structure generation (the only requirement is that these custom objects implement the ITypedList/IEnumarable/ICustomTypeDescriptor interfaces). Furthermore, RadGridView supports out-of-the-box binding to sub-objects, nullable and business objects.


11. Conditional formatting - RadGridView enables you to apply conditional formatting to grid elements for enhanced readability and usability of the displayed data. Conditional formatting can be applied programmatically or by the user at run-time.


12. Context menu support - The context menu provides extra usability and richness to any application. The default RadGridView context menu provides support for sorting, formatting, grouping, column selection and automatic column width adjustment. You can extend the context menu to add your own menu items and display your menus conditionally.

? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadGridView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Information Computer and Technology - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger