-
Displaying Hierarchical Data [Janus GridEX WinForms Control v3.5 for .NET]
Steps to reproduce this sample:
1) Create a new "Windows Application" Project.
2) Add a new Data Source to the application:
Click in the "Add New Data Source..." menu under "Data" and follow the wizard to add "Customers", "Orders" and "Order Details" tables from JSNorthWind.mdb database.
In the tutorial we used Provider = "Microsoft Access Database File (OLE DB)" and Database file name = "C:\JSNorthWind.mdb".
3) Build the project to be able to see JSNorthwindDataSet, CustomersTableAdapter, OrdersTableAdapter and Order_DetailsTableAdpater as components in the Toolbox.
4) Drag from the tool box JSNorthwindDataSet, CustomersTableAdapter, OrdersTableAdapter and Order_DetailsTableAdpater components.
5) Add GridEX Control to a tab in the Toolbox window by right clicking in the Toolbox window and choosing "Customize Toolbox..." menu. When the dialog appears, select ".Net Framework Components" tab, check "GridEX" control in the list and click OK.
Note: If GridEX control doesn't appear as an option in the list, click the Browse button and open Janus.Windows.GridEX.dll.
6) Drag a GridEX control from the toolbox into the Form designer.
Select GridEX control in the Form and set the following properties in the properties window:
DataSource = JSNorthwindDataSet1
DataMember = "Customers"
7) Right click in the GridEX control and select "Retrieve Hierarchical Structure" menu. This action will force the control to read the DataSource structure and create the tables and columns needed to show all the fields in the tables.
8) In the Load event of the Form fill the tables in the dataset with the following code:
In VB.Net
CustomersTableAdapter1.Fill(JsNorthWindDataSet1.Customers)
OrdersTableAdapter1.Fill(JsNorthWindDataSet1.Orders)
Order_DetailsTableAdapter1.Fill(JsNorthWindDataSet1.Order_Details)
In C#.Net
customersTableAdapter1.Fill(jsNorthWindDataSet1.Customers);
ordersTableAdapter1.Fill(jsNorthWindDataSet1.Orders);
order_DetailsTableAdapter1.Fill(jsNorthWindDataSet1.Order_Details);
9) Press F5 and run the project.
Source Of Information : Janus v3.5 Help Files for VS 2008
Subscribe to:
Post Comments (Atom)
0 comments: