This is a migrated thread and some comments may be shown as answers.
RadMenuGroup
1 Answer 19 Views
This is a migrated thread and some comments may be shown as answers.
ghadeer
Top achievements
Rank 1
ghadeer asked on 28 May 2008, 06:38 AM
Hi All,
am just start building a website and I will use radmenu ,so I will try to get it  but I get error on Menugroup name space.

could any one help me ?????????


my code:

protected void Page_Load(object sender, EventArgs e)

{

GenerateMenu();

}

private void GenerateMenu()

{

string _ConnectionString = "PROVIDER=MSDAORA;USER ID=HSAJAD;PASSWORD=SAJJAD;DATA SOURCE=HCARE.WORLD";

OleDbConnection OldDbCon = new OleDbConnection(_ConnectionString);

OldDbCon.Open();

OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT id,parentId,e_text,E_URL FROM INTERNET_MENU ", OldDbCon);

DataSet ds = new DataSet();

adapter.Fill(ds);

ds.Relations.Add(

"NodeRelation", ds.Tables[0].Columns["id"], ds.Tables[0].Columns["parentId"], false);

MenuGroup MainGroup =

new MenuGroup();

MainGroup.Flow = PresentationDirection.Horizontal;

RadMenu1.RootGroup = MainGroup;

foreach (DataRow dbRow in ds.Tables[0].Rows)

{

if (dbRow.IsNull("parentId"))

{

Telerik.WebControls.

RadMenuItem item = new Telerik.WebControls.RadMenuItem();

item.Text = dbRow[

"Text"].ToString();

MainGroup.AddItem(item);

RecursivelyPopulate(dbRow, item);

}

}

OldDbCon.Close();

}

 

 

private void RecursivelyPopulate(DataRow dbRow,Telerik.WebControls.RadMenuItem item)

{

MenuGroup CurrentGroup =

new MenuGroup();

foreach (DataRow childRow in dbRow.GetChildRows("NodeRelation"))

{

Telerik.WebControls.

RadMenuItem childItem = new Telerik.WebControls.RadMenuItem();

childItem.Text = childRow[

"Text"].ToString();

CurrentGroup.AddItem(childItem);

RecursivelyPopulate(childRow, childItem);

}

if (CurrentGroup.Items.Count > 0)

{

item.ChildGroup = CurrentGroup;

}

}






please help me as soon as possible
thanks in advance
ghadeer

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 24 Jun 2008, 10:03 AM
Hi ghadeer,

Please answer our questions in Ticket ID-145953.

Sincerely yours,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Menu
Asked by
ghadeer
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or