473,503 Members | 1,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hierarcial view of a menu?

17 New Member
Expand|Select|Wrap|Line Numbers
  1.         Menu1.Items.Clear();
  2.         SqlDataAdapter dadSubCat = new SqlDataAdapter();
  3.         dadSubCat.SelectCommand = new SqlCommand("SELECT ID,PID,Title FROM Page where userid='user1'", con);
  4.         DataSet dsCat = new DataSet();
  5.         dadSubCat.Fill(dsCat, "Page");
  6.         dsCat.Relations.Add("ParentChild", dsCat.Tables["Page"].Columns["ID"], dsCat.Tables["Page"].Columns["PID"], true);
  7.         int count = 0;
  8.         foreach (DataRow categoryRow in dsCat.Tables["Page"].Rows)
  9.         {
  10.             DataRow[] subCatRows = categoryRow.GetChildRows("ParentChild");
  11.             if (categoryRow.GetParentRows("ParentChild").Length == 0)
  12.             {
  13.                 skmMenu.MenuItem mNode = new skmMenu.MenuItem("<img src=\"menublip.gif\" align=\"absmiddle\">" + categoryRow["Title"].ToString(), "");
  14.  
  15.                 foreach (DataRow row in subCatRows)
  16.                 {
  17.                     string Title = row["Title"].ToString();
  18.                     mNode.SubItems.Add(new skmMenu.MenuItem(Title, ""));
  19.  
  20.  
  21.                 }
  22.  
  23.                Menu1.Items.Add(mNode);
  24.             }
  25.  
  26.         }
  27.  
  28.  
this is for one child menu.
but how can i do it for a hirarcial menu?
Apr 29 '09 #1
0 1040

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2874
by: Nancy | last post by:
Hi, Guys, I don't know why I can't view some webpages source code by click "View->Source" menu of Browser. These webpage source code can be viewed in same way by using other computers. My OS is...
29
9746
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
18
2520
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
1
2469
by: Kevin Myers | last post by:
Hello, I'm an experienced application developer in some languages (including various SQL dialects), but have very little experience with MS Access or VBA, and am having trouble figuring out how...
1
4893
by: Jesper DK | last post by:
Hi, I have docked a tree view to the left on a form. When I start to populate this tree view with nodes, a horizontal scroll box appears in the bottom of the tree view even though thee tree...
6
4610
by: Robert W. | last post by:
I'm building my first major C# program and am try to use best practices everywhere. So I've implemented the "Document/View Model" whereby: - There's a Windows Form, which we'll call "formView" -...
4
2716
by: Nadav Popplewell | last post by:
Hi everybody, I've install Visual studio Team Edition for Testers on my computers, And I can't seem to find how to show the toolbox. The documenation says there should be a 'Toolbox' menuitem...
0
1374
by: Christian | last post by:
Hi all, i already posted this in dotnet.vb.controls but i need some help, so i cant wait... I have written a web control library and have some problems with it. The Library contains only two...
4
5041
by: RLN | last post by:
I have a form that does not display correctly. frm1 opens frm2 via a command button. My three problems with frm2: 1. Displays in form view when called from the button. (should be datasheet...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.