RadToolBar for ASP.NET AJAX

RadControls for ASP.NET AJAX

RadToolBar can be bound to DataSet, DataTable, and DataView.

Creating the data table in code

The following example illustrates how to bind to a DataTable that is created in code. The same type of logic can easily be applied to a DataView instead:

  1. Create a function that dynamically creates the data source (in this case, a DataTable):
  2. Set the DataSource property of the toolbar to the DataTable. At the same time, use the RadToolBar properties to specify the fields to use for the Text and Value properties of buttons. Finally, call the DataBind method to bind the toolbar:
  3. Create a ButtonDataBound event handler to set additional properties on the buttons:

Fetching the data from a separate database

You can use a DataSet when the data comes from a separate database. Just use a data adapter component to assign the data from the database to a DataSet:

Note

When binding to a DataSet component, you can set the DataMember property to identify the DataTable within the DataSet to which the toolbar should be bound.

See Also