Adds a user-defined data object on the top hierarchical level of the GridControl. The data object will be automatically associated with the DataObjectAccessor
Namespace: Dapfor.Wpf.ControlsAssembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)
Syntax
C# |
---|
public Row Add( Object dataObject ) |
Visual Basic |
---|
Public Function Add ( dataObject As Object ) As Row |
Visual C++ |
---|
public: Row^ Add( Object^ dataObject ) |
F# |
---|
member Add : dataObject : Object -> Row |
Parameters
- dataObject
- Type: System..::..Object
The user-defined object. If this object implements INotifyPropertyChanged interface, then the Row will subscribe for the notifications. When a notification is received, the Row will synchronize the calling thread with the GUI thread and will forward the notification to the GridControl in the asynchronous way without blocking the calling thread.
Return Value
Type: RowA new Row, having the data object if success; Otherwise null. The returned Row may be used to build any hierarchy in the GridControl.
Remarks
The function creates a new Row which wraps the user-defined data object. The Row specifies the position in Rows,
Nodes, Children and VisibleChildren collections, handles the visibility, and appearance of the data.
Examples
Demonstrates how to add user-defined objects to the GridControl
Copy | |
---|---|
void PopulateGrid(GridControl grid) { //Add a new object to the scrollable rows on the top hierarchical level Row row = grid.Rows.Add(new SomeObject()); //Add some children to the already inserted row row.Add(new SomeChild()); row.Add(new SomeChild()); } |
Thread Safety
The function is thread safe. The Row is added in the synchronous way with blocking the calling thread.