Edit this page

Binding to LinqDataSource

Since the Q2 2008 SP1 release RadTabStrip supports hierarchical data binding to the LinqDataSource control. This article shows how to do this in Design Time:

  1. Create a new Web Site in Visual Studio 2008 and copy the Northwind.mdf database in your App_Data folder.

  2. Add a new "Linq to SQL Classes" item named "Northwind.dbml":
    Add new item

  3. Open Northwind.dbml in design mode and drag the Employees table from Server Explorer. The Employees table is self referencing and suites perfectly for this example:
    "Employee" table

  4. Open Default.aspx in design mode and drag a new RadTabStrip instance.

  5. Open the smart tag and select "New data source":
    Choose DataSource

  6. Choose "LinqDataSource" from the "Data Source Configuration Wizard":
    Choose DataSource type

  7. Configure the newly created data source to use the NorhtwindDataContext object:
    Choose context object

  8. Select the "EmployeeID", "LastName" and "ReportsTo" columns from the "Configure Data Source" dialog:
    Configure data selection

  9. Click "Finish" and open the RadTabStrip smart tag to complete the configuration.

  10. Select "EmployeeID" for the DataFieldID property, "ReportsTo" for the DataFieldParentID property and "LastName" for the DataTextField property:
    Smart Tag Data Field ID
    Smart Tag Data Field Parent ID
    Smart Tag Text Field ID

  11. Save your page and run the web site. You should see a page with the following RadTabStrip:
    TabStrip Bound with LINQ to SQL

See Also