Click or drag to resize
KaxTabControlDataFieldParentID Property
Gets or sets the field from the data source which is the "parent" column in the "parent-child" relationship used to databind the KaxTabControl control.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public override string DataFieldParentID { get; set; }

Property Value

Type: String
A string that specifies the field of the data source that will be the "parent" column during databinding. The default is empty string.
Remarks

KaxTabControl requires both DataFieldID and DataFieldParentID properties to be set in order to be hierarchically databound.

The value of the column specified by DataFieldParentID must be null (Nothing) for root tabs. This is a requirement for databinding KaxTabControl.

Examples
The following example demonstrates how to use DataFieldID and DataFieldParentID.
DataTable data = new DataTable();
data.Columns.Add("MyText");
data.Columns.Add("MyID", typeof(int));
data.Columns.Add("MyParentID", typeof(int));

data.Rows.Add(new object[] {"Root Tab 1", 1, null});
data.Rows.Add(new object[] {"Child Tab 1.1", 3, 1});
data.Rows.Add(new object[] {"Root Tab 2", 2, null});
data.Rows.Add(new object[] {"Child Tab 2.1", 4, 2});

KaxTabControl1.DataSource = data;
KaxTabControl1.DataTextField = "MyText";            //"MyText" column provides values for the Text property of databound tabs
KaxTabControl1.DataFieldID = "MyID";                //"MyID" column provides values for the "child" column in the relation.
KaxTabControl1.DataFieldParentID = "MyParentID";    //"MyParentID" column provides values for the "parent" column in the relation.
KaxTabControl1.DataBind();
See Also