New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Binding to a Data Source

This tutorial shows how to bind RadToolBar to an AccessDataSource:

  1. Locate the file "Chart.mdb" file that appears in the Live Demos/App_Data folder of your RadControls installation. Drag this file to the App_Data folder in the Solution Explorer for your project:

    toolbar chartmdb

  2. Drag a RadToolBar component from the toolbox onto your Web page. The RadToolBar Smart Tag should appear automatically:

    toolbar smarttag

  3. In the RadToolBar Smart Tag, use the Skin drop-down to change the skin for the RadToolBar to "Hay":

    toolbar chooseskin

  4. Still in the Smart Tag, open the Choose Data Source drop-down and select New Data Source.

    toolbar newdatasource

  5. The Data Source Configuration Wizard appears. In the Select a DataSource Type screen, specify an AccessDataSource and click OK.

    Data Source Configuration Wizard

  6. In the Choose a Database screen, click the Browse button, and select the "Chart.mdb" file. Then choose Next to continue:

    Configure Data Source

  7. In the Configure the Select Statement screen, choose Specify columns from a table or view. Select the "Subcategory" table from the Name drop down, and select the "Id", "Name", and "Category_id" fields:

    Configure Data Source

  8. Click the WHERE button to add a where clause to your query. In the Add WHERE Clause screen, set the Column to "Category_Id", the Operator to "=", the Source to "None", and set the parameter value to "1":

    Add Where Clause

  9. Click the Add button to add the WHERE clause, and then click OK.

  10. Back in the Configure The Select Statement page, click Next to accept the select statement.

  11. Click the Test Query button to see the data from the data source. Then choose Finish to exit the Wizard:

    ToolBar Test Query

  12. In the Properties pane for the RadToolBar component:

  13. Set the DataTextField property to "Name".

  14. Set the DataValueField property to "Id".

    toolbar datafieldproperties

  15. Run the application. Note that the tabs are labelled using the "Name" field of the data source:

    Bound ToolBar

See Also

In this article
See Also
Not finding the help you need?
Contact Support