473,804 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

nested bulletedlist ?

Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?

Jul 25 '06 #1
6 7880
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?

Jul 25 '06 #2
My apologies, I should have explained a little further.
I'm trying to create it like this...

BulletedList mybList = new BulletedList();
ListItem li = new ListItem();
li.Value = "myvalue";
li.Text = "mytext";
myList.Items.Ad d(li);

However I can't add another BulletedList control to a ListItem, or to
another BulletedList.

BulletedList subList = new BulletedList();
myList.Controls .Add(subList);

I don't think I'm just being lazy, I know the principle of hard coding
lists in html as you showed me, but it must be possible to do this
dynamically?

Thanks,


Peter wrote:
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?
Jul 25 '06 #3
Sure, you could do it dynamically.
Each HTML element you need can be created as an HtmlGenericCont rol, and you
can nest them accordingly, then attach the main one either to either a
Placeholder or say, a Panel.
If you are adventurous, you could even build a custom control to do the same.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
My apologies, I should have explained a little further.
I'm trying to create it like this...

BulletedList mybList = new BulletedList();
ListItem li = new ListItem();
li.Value = "myvalue";
li.Text = "mytext";
myList.Items.Ad d(li);

However I can't add another BulletedList control to a ListItem, or to
another BulletedList.

BulletedList subList = new BulletedList();
myList.Controls .Add(subList);

I don't think I'm just being lazy, I know the principle of hard coding
lists in html as you showed me, but it must be possible to do this
dynamically?

Thanks,


Peter wrote:
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?
>
>

Jul 25 '06 #4
Perfect- thank you. It does seem strange though, that I have to use
the generic control when there's this wonderful bulletedlist control.
Maybe it's just me but I would have thought it would have been sensible
to allow adding sub lists.
Anyway, thanks again.

B
Peter wrote:
Sure, you could do it dynamically.
Each HTML element you need can be created as an HtmlGenericCont rol, and you
can nest them accordingly, then attach the main one either to either a
Placeholder or say, a Panel.
If you are adventurous, you could even build a custom control to do the same.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
My apologies, I should have explained a little further.
I'm trying to create it like this...

BulletedList mybList = new BulletedList();
ListItem li = new ListItem();
li.Value = "myvalue";
li.Text = "mytext";
myList.Items.Ad d(li);

However I can't add another BulletedList control to a ListItem, or to
another BulletedList.

BulletedList subList = new BulletedList();
myList.Controls .Add(subList);

I don't think I'm just being lazy, I know the principle of hard coding
lists in html as you showed me, but it must be possible to do this
dynamically?

Thanks,


Peter wrote:
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"craptiger" wrote:
>
Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?
Jul 25 '06 #5
Hi,

Just realised another stumbling block...

My nice BulletedList control had an auto postback, and was telling me
on postback which one had been clicked. How can I make this control
postback when a link in the menu is clicked?
I can't get it to runat server.
I think I might be going about this whole thing the wrong way here!!!

Any ideas?

Peter wrote:
Sure, you could do it dynamically.
Each HTML element you need can be created as an HtmlGenericCont rol, and you
can nest them accordingly, then attach the main one either to either a
Placeholder or say, a Panel.
If you are adventurous, you could even build a custom control to do the same.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
My apologies, I should have explained a little further.
I'm trying to create it like this...

BulletedList mybList = new BulletedList();
ListItem li = new ListItem();
li.Value = "myvalue";
li.Text = "mytext";
myList.Items.Ad d(li);

However I can't add another BulletedList control to a ListItem, or to
another BulletedList.

BulletedList subList = new BulletedList();
myList.Controls .Add(subList);

I don't think I'm just being lazy, I know the principle of hard coding
lists in html as you showed me, but it must be possible to do this
dynamically?

Thanks,


Peter wrote:
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"craptiger" wrote:
>
Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?
Jul 25 '06 #6
got around it by dynamically adding linkbuttons, which post back.
not ideal but it works!

Thanks for your help anyway.

B
craptiger wrote:
Hi,

Just realised another stumbling block...

My nice BulletedList control had an auto postback, and was telling me
on postback which one had been clicked. How can I make this control
postback when a link in the menu is clicked?
I can't get it to runat server.
I think I might be going about this whole thing the wrong way here!!!

Any ideas?

Peter wrote:
Sure, you could do it dynamically.
Each HTML element you need can be created as an HtmlGenericCont rol, and you
can nest them accordingly, then attach the main one either to either a
Placeholder or say, a Panel.
If you are adventurous, you could even build a custom control to do the same.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"craptiger" wrote:
My apologies, I should have explained a little further.
I'm trying to create it like this...
>
BulletedList mybList = new BulletedList();
ListItem li = new ListItem();
li.Value = "myvalue";
li.Text = "mytext";
myList.Items.Ad d(li);
>
However I can't add another BulletedList control to a ListItem, or to
another BulletedList.
>
BulletedList subList = new BulletedList();
myList.Controls .Add(subList);
>
I don't think I'm just being lazy, I know the principle of hard coding
lists in html as you showed me, but it must be possible to do this
dynamically?
>
Thanks,
>
>
>
>
Peter wrote:
As it often turns out, it would have been easier trying it rather than
posting to a C# newsgroup and waiting for an answer.
Short answer: yes.
Example:
<ul>
<li>line 1
<liline 2
<div>
<ul>
<liindented sublist
</ul>
</div>
</ul>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"craptiger" wrote:

Is it possible to nest bulleted lists? I'm not overly competent at c#
yet but have been given a project by my boss and it involves making a
menu type control from a 3 level xml file.
I've managed to build it by making one list, and dynamically adding
items to it, but want to indent them by nesting lists within lists.
Can anyone post a really simple example of how I might do this?
>
>
>
>
Jul 25 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1184
by: benliu | last post by:
I have a bulletedlist that I have databound to a sqldatasource. I am using it with displaymode=hyperlink. I set the datatextfield to be one of the fields returned by the sqldatasource. However, with the url field, i would like to build the url from one of the fields returned. Specifically, the url is formed by setting a querystring value to the id returned in the field: http://localhost/news.aspx?nwId=533 So the datasource returns...
2
3980
by: Stan SR | last post by:
Hi, I need to add (dynamically) sub bulletedList to a bulletedList Ex : <ul> <li>store A <ul> <li>Europe</li> <li>Africa</li>
0
1715
by: Tony | last post by:
I want to display the text of items in a bulletedlist on multiple lines, but I can't get it working. Here is a sample version of my code below: protected void blStaff_DataBound(object sender, EventArgs e) { foreach (ListItem lstItem in ((BulletedList)sender).Items) { lstItem.Text = "A" + "<br>" + "B"; } }
3
1915
by: Stan SR | last post by:
Hi, I want to add dynamically items within a bulletlist. Everything works when I add text like BulletedList mybullet; mybullet.Items.Add("blabla"); But how to add an image (I m not talking about decoration-style)
5
2673
by: =?Utf-8?B?SmliZXkgSmFjb2I=?= | last post by:
Hi: I'm using the <asp:BulletedListcontrol in a TemplateField in a GridView. The extra height generated by this control increases the height of the rest of the row it's in. Is there a way around this? Thanks, Jibey
1
1159
by: njain | last post by:
i want to use mailto with BulletedList so that i can open a outlook inbox on click of list item.my list is fill by sql server database.
6
4713
by: Nathan Sokalski | last post by:
I am creating a BulletedList and would like to use a - as the bullet. However, I could not find a way to do this using the properties for the BulletedList control. Is there a way to use a specific character for the bullet without manually adding it to each ListItem? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
1
3038
by: Håkan | last post by:
Hi! How do you format the href field of the <a>-tag when you use a databound BulletedList in Hyperlink mode? The field in the database contains an ID that I want to use as a parameter in the url for the Bulletedlists hyperlink tag. /Håkan
0
1176
by: ngchaitra | last post by:
hi, I am using bulletedlist control and have set displaymode as linkbuttons. And binding data to that. Till here it is working fine. Now when i select some link on that it has to move to some other page. but how to do this i am not able to retrieve the text from the bulleted list. I mean based on the value present in the bulletedlist i need to write the query. But finding difficult since it does not have either a text property or...
0
9716
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10354
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
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 we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.