Click or drag to resize
Accord.NET (logo)

ExtensionsAllowNestedProperties Method

Enables the display of recursively nested properties in the Windows.Forms' DataGridView control.

Namespace:  Accord.Controls
Assembly:  Accord.Controls (in Accord.Controls.dll) Version: 3.8.0
Syntax
public static void AllowNestedProperties(
	this DataGridView dataGridView,
	bool value
)
Request Example View Source

Parameters

dataGridView
Type: System.Windows.FormsDataGridView
The DataGridView to enable nested properties.
value
Type: SystemBoolean
True to use nested properties, false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataGridView. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
This method will register a custom cell formatting event in the DataGridView and retrieve any nested property specified in the column's DataPropertyName property using reflection. This method is based on th idea by Antonio Bello, originally shared in: http://www.developer-corner.com/2007/07/datagridview-how-to-bind-nested-objects_18.html
See Also