RadTabStrip for ASP.NET

Overview and types of data sources Send comments on this topic.
See Also
Data binding > Overview and types of data sources

Glossary Item Box

Overview

Data Binding is achieved by setting the DataSource property and calling the DataBind() method. If you are using declarative data sources such as AccessDataSource or SiteMapDataSource, databinding is achieved by specifying the DataSourceID.

You can get a working demo application on Data Binding from our code library here.  

Usually, you would also want to do one or some of the following:

  1. Set Text, Value or NavigateUrl properties using:
  2. DataTextField - Gets or sets the field of the data source that provides the Text of the tabstrip items.
  3. DataNavigateUrlField - Gets or sets the field of the data source that provides the NavigateUrl of the tabstrip items.
  4. DataValueField  - Gets or sets the field of the data source that provides the Value of the tabstrip items
  5. Set other properties

    Properties other than the above three (Text, Value and NavigateUrl) can be set in the TabDataBound event:
    C# Copy Code
    protected void RadTabStrip1_TabDataBound(object sender, TabStripEventArgs e)
    {
      e.Tab.ToolTip =
    "Read more about " + (string)DataBinder.Eval(e.Tab.DataItem, "Text");
    }
    VB.NET Copy Code
    Protected Sub RadTabStrip1_TabDataBound(ByVal sender As Object, ByVal e As TabStripEventArgs)
       e.Tab.ToolTip = "Read more about " + CStr(DataBinder.Eval(e.Tab.DataItem, "Text"))
    End Sub
  6. Establish hierarchy through ID to ParentID relationship using:
  7. DataFieldID - The name of the DataColumn holding the ID value.
  8. DataFieldParentID - The name of the DataColumn holding the ParentID value. The id of the root items should be null.
  9.  

    With respect to binding to Telerik RadTabStrip, data sources can be divided into two major categories:

    1. Data Sources from which Telerik RadTabStrip can create tabstrip item hierarchy

    When the tabstrip is bound to such data sources it can have not only root items, but also child items:

    root tab 1   root tab 2

                     child tab 2.1   child tab 2.2

    1. Data Sources from which Telerik RadTabStrip will automatically create tabstrip item hierarchy:
      • XmlDataSource
      • SiteMapDataSource
    2. Data Sources which require the ID to ParentID relationship to establish hierarchy:
      • DataTable, DataSet, DataView
      • SqlDataSource
      • AccessDataSource
    The ID to ParentID relationship is established by setting the DataFieldID and DataFieldParentID properties

     

    2. Data Sources from which Telerik RadTabStrip cannot create tabstrip item hierarchy

    When the tabstrip is bound to such Data Sources it is flat, i.g. it has only root items

    root tab 1   root tab 2   root tab 3

    Setting DataFieldID and DataFieldParentID will have no effect.

     

     

    See Also