RadMenu for ASP.NET

RadMenu Send comments on this topic.
DataFieldID Property
See Also  Example
Telerik.WebControls Namespace > RadMenu Class : DataFieldID Property


Gets or sets the field from the data source which is the "child" column in the "parent-child" relationship used to databind the RadMenu control.   

 

Namespace: Telerik.WebControls
Assembly: RadMenu (in RadMenu.dll)

Syntax

Visual Basic (Declaration) 
Public Overridable Property DataFieldID As String
Visual Basic (Usage)Copy Code
Dim instance As RadMenu
Dim value As String
 
instance.DataFieldID = value
 
value = instance.DataFieldID
C# 
public virtual string DataFieldID {get; set;}

Return Value

A string that specifies the field of the data source that will be the "child" column during databinding. The default is empty string

Example

Visual BasicCopy Code
Dim dbCon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/menu/Data/Tree.mdb"))
dbCon.Open()

Dim adapter As New OleDbDataAdapter("SELECT * FROM Links", dbCon)
Dim ds As New DataSet()
adapter.Fill(ds)

RadMenu1.DataTextField = "TextColumn"
RadMenu1.DataValueField = "ValueColumn"
RadMenu1.DataFieldID = "ID"
RadMenu1.DataFieldParentID = "ParentID"
RadMenu1.DataNavigateUrlField = "URL"

RadMenu1.DataSource = ds
RadMenu1.DataBind()
C#Copy Code
OleDbConnection dbCon = new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/menu/Data/Tree.mdb"));
dbCon.Open();

OleDbDataAdapter adapter =
new OleDbDataAdapter("SELECT * FROM Links", dbCon);
DataSet ds =
new DataSet();
adapter.Fill(ds);

RadMenu1.DataTextField =
"TextColumn"
RadMenu1.DataValueField = "ValueColumn"
RadMenu1.DataFieldID = "ID";
RadMenu1.DataFieldParentID =
"ParentID";
RadMenu1.DataNavigateUrlField =
"URL";

RadMenu1.DataSource = ds;            
RadMenu1.DataBind();
    

Remarks

RadMenu requires both DataFieldID and DataFieldParentID properties to be set in order to be databound recursively.

Requirements

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also