Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

Name

DataGrid

Synopsis

This class is the successor to the old unmanaged FlexGrid control, and has considerably more power, fully supporting complex data-binding scenarios.

A grid offers a two dimensional view of the rows and columns on a data source. The data source itself may consist of several related tables, each with different rows and columns, so the grid offers support for drilling down through these relations, updating the display to reflect the current view on the data.

There are a variety of basic areas in the grid whose appearance you can change. You can show and hide a caption (title) area with the CaptionVisible property. You can set the CaptionFont, CaptionForeColor, and CaptionBackColor, as well as the CaptionText.

If a particular row in the data source has been defined to have relations to another table, the grid displays a hyperlink for you to click on to follow that relation. You can set its LinkColor and LinkHoverColor. This drill-down behavior is enabled and disabled with the AllowNavigation property. When you have drilled down into a table, a line is added to display the parent rows through which you have navigated. You can set the ParentRowsBackColor, ParentRowsForeColor, and visibility (ParentRowsVisible). In addition, you can set the ParentRowsLabelStyle to display either the parent ColumnName, TableName, or both. You can also NavigateTo() a particular row and relation, or NavigateBack() to the parent of the current view.

Then, there are the column headers (which ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata