473,796 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a custom character as the bullet in a BulletedList

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
nj********@hotm ail.com
http://www.nathansokalski.com/
Mar 15 '07 #1
6 4710
On Mar 15, 9:51 pm, "Nathan Sokalski" <njsokal...@hot mail.comwrote:
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.
To control the style of bullet used, use the BulletedList.Bu lletSyle
property:

http://msdn2.microsoft.com/en-us/lib...le(VS.80).aspx

It has no standard style for a "-", but you can use a custom image,
for example:

<asp:BulletedLi st BulletImageUrl= "/images/minus.gif"
BulletStyle="Cu stomImage">

Mar 15 '07 #2


If u desire some special charecter as a bullet for the bullet list, you
could try this option.

<asp:BulletedLi st ID="BulletedLis t1"
style="list-style-type: none;"
DataTextField=" bulletContent"
runat="server"
DataTextFormatS tring="- {0:0}" >
</asp:BulletedLis t>

The style property's list-style-type needs to be set to none, so that the
browser does not prefix the content with the default bullet. The special
charecter that you would like to use as your bullet can be given in the
DataTextFormatS tring property of the bullet list " - {0:0}".
I hope this helps.

-Parvathy Padmanabhan
Mar 30 '07 #3
Would that work if I am not using DataBinding? It looks to me like you
assumed I was using DataBinding, but there are many cases with BulletedLists
that I do not use DataBinding. Would your suggestion still work? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Parvathy Padmanabhan" <Pa************ *****@discussio ns.microsoft.co mwrote
in message news:8E******** *************** ***********@mic rosoft.com...
>

If u desire some special charecter as a bullet for the bullet list, you
could try this option.

<asp:BulletedLi st ID="BulletedLis t1"
style="list-style-type: none;"
DataTextField=" bulletContent"
runat="server"
DataTextFormatS tring="- {0:0}" >
</asp:BulletedLis t>

The style property's list-style-type needs to be set to none, so that the
browser does not prefix the content with the default bullet. The special
charecter that you would like to use as your bullet can be given in the
DataTextFormatS tring property of the bullet list " - {0:0}".
I hope this helps.

-Parvathy Padmanabhan

Mar 30 '07 #4
Hi,

If you donot have a datasource object and need to give asp:ListItem
objects in the html source, in that case, retain the
style="list-style-type: none;" property of the bulletlist and remove the
DataTextFormatS tring="- {0:0}" property.

To each of your asp:ListItem 's text property prifix the value with "- ".

<asp:BulletedLi st ID="BulletedLis t1" style="list-style-type: none;"
runat="server">
<asp:ListItem Text="- Item 1" Value="1"></asp:ListItem>
<asp:ListItem Text="- Item 2" Value="2"></asp:ListItem>
</asp:BulletedLis t>

-Parvathy Padmanabhan
Mar 30 '07 #5
I realize that that would give the same initial result, but it takes away
the option to use or set the text property without extra coding. In other
words, I want the Text property to be the text and nothing but the text so
that I can easily work with the text property in the codebehind. Any other
ideas? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Parvathy Padmanabhan" <Pa************ *****@discussio ns.microsoft.co mwrote
in message news:A0******** *************** ***********@mic rosoft.com...
Hi,

If you donot have a datasource object and need to give asp:ListItem
objects in the html source, in that case, retain the
style="list-style-type: none;" property of the bulletlist and remove the
DataTextFormatS tring="- {0:0}" property.

To each of your asp:ListItem 's text property prifix the value with "- ".

<asp:BulletedLi st ID="BulletedLis t1" style="list-style-type: none;"
runat="server">
<asp:ListItem Text="- Item 1" Value="1"></asp:ListItem>
<asp:ListItem Text="- Item 2" Value="2"></asp:ListItem>
</asp:BulletedLis t>

-Parvathy Padmanabhan

Mar 31 '07 #6
Hi,
In that case, probabaly creating a - image and giving the bullet image url
should help.
But the ListItem also has a Value attribute. Can you not set the value
attribute and use that for the processing in the code behind, or is it that
you are using both the text and the value for totally diffrent things..? To
what i know the only options what cld be tried are,

1. Create a Datatable object, bind it to your control. That way you can use
the DataTextFormat property.
2. Prefix the text content with a "-" and set the text that u need for the
processing in the code behind to the value property of the listItem.
3. Create a "-" as an image and pass the bulletImage url.

So, its up to you to chose what cld best suit your requirement.

Jus incase you do come up with another way of doing it..kindly update me on
it.

-Parvathy Padmanabhan
Mar 31 '07 #7

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

Similar topics

6
2794
by: dbaldi | last post by:
(this is follow-on message to one posted yesterday) I'm trying to reproduce the capabilities in both Notepad and Excel, whereby a Unicode text file with Unicode characters can be converted to ANSI, while still preserving the unicode characters within. Specifically, I'm using the unicode character &x2022, which is a largish bullet. I've tried this:
6
7880
by: craptiger | last post by:
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?
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
3978
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>
2
1724
by: Steve Kershaw | last post by:
Hi, I have a BulletList that I fill with the BulletList1.Items.Add("text here"); method. When I display this BulletList I don't get the bullet displayed. I've tried: BulletedList1.BulletImageUrl = "~/Images/BulletedList/Bullet.jpg"; but it still dosen't display any bullet. Am I missing something here?
3
1914
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)
1
1158
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.
0
991
by: Nathan Sokalski | last post by:
I am trying to make an unordered list that has different levels (like we used to with the ul tag in html). However, I am having trouble nesting the BulletedList control. Could somebody please either show me an example or direct me to a site that can help me? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
3
2187
by: pdeb1234 | last post by:
i am trying to dynamically load the image of a bullet and then manipulate it using a looping function( with setTimeout() and clearTimeout() methods). here's the code>>>> <html> <head> <script type="text/javascript" language="JavaScript"> var timer; function keyPress( ) { var bullet=new Image( );
0
9684
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
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
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
10017
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...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
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
5445
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
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
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.