Just like binding with relational lists, TreeView can be bound to relational datasets, where relationships are defined between individual tables. The TreeView control can automatically generate the KeyField and ParentKeyField properties from the relations in the dataset. This also helps in displaying the tables hierarchically by setting the DataSource and DataMemberPath properties of BindingInfo class.
The image below depicts dataset binding in the TreeView control.
To bind TreeView to a DataSet, follow these steps:
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|
C# |
コードのコピー
|
---|---|
Type your example code here. It will be automatically colorized when you switch to Preview or build the help system.
|