RadMenu for ASP.NET

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


Gets or sets the field from the data source that provides values for the Text property of the items.   

 

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

Syntax

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

Return Value

A string that specifies the field from the data source that provides values for the Text property of the items. The default value 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();
    

Requirements

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

See Also