BulletedList Control


K

KSO

I can't get my BulletedList control to work properly !

I wish to change it's displaymode by clicking on a "bulleted list of
choices" and her is the click-event:

protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
{label1.Text = "Now it should bel " + BulletedList1.Items[e.Index].Text;
BulletedList1.BulletStyle = (BulletStyle)e.Index;

}

Why ?
 
Ad

Advertisements

K

KSO

I have tried another solution to get the BulletedList control to change it's
displaymode:

string styleName = BulletedList1.Items[e.Index].Text;
BulletStyle style = (BulletStyle)Enum.Parse(typeof(BulletStyle), styleName);
BulletedList1.BulletStyle = style;

as a part of the BulletedList1_Click - but same result = NO CHANGE !

The BulletedList looks the same as the initial look - only the texts, no
number or lowercase letters - no nothing - why ?
 
M

Mansi Shah

Hi,

I think you are little bit confused about your work. Anyways, if you are
trying to change the style of bulltedlist then it takes just 1 line code
and that is:

BulletedList1.BulletStyle = BulletStyle.Disc;

You can use any style instead of 'Disc'

Hope you are looking for something like this.. :)

Mansi Shah.
 
K

KSO

Yeah - you'r right about the confusion but I have tried what you suggest !

But the BullettedList control on the IE screen looks the same NO MATTER what
values I give to BulletedList1.BulletStyle - that's the problem.

Why ?

Is something wrong with my IE ?
 
Ad

Advertisements

M

Mansi Shah

Can you tell me which version of IE are you using and in which
part/event you are trying to change bulletlist style in .cs file?

Mansi Shah.
 
K

KSO

I'm using IE version 7.0.5730.11

I have a BulletedList with texts just like all values in BulletStyle.

DisplayMode of the BulletedList is LinkButton and NO MATTER witch value og
the Bulletstyle I choose in the Page_Load, the list looks the same -
If I use "BulletedList1.BulletStyle = BulletStyle.Numbered;" there is STILL
no numbers (only the text) !

When I click on the texts in the list I would like to change the look of the
list to the value I clicked on - so I have this code :

protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
{
Label1.Text = "No it should be: " + BulletedList1.Items[e.Index].Text;
BulletedList1.BulletStyle = (BulletStyle)Enum.Parse(typeof(BulletStyle),
BulletedList1.Items[e.Index].Text);
}

But ONLY the text "Now it should be: XXX" changes on the IE screen - no
numbers, no lowercase - no nothing !

That's my problem - and I can't get it !

Best regards
KSor, Denmark
 
M

Mansi Shah

Hi,

IE 7.0 has no problem. Got your problem but not the solution. As per my
knowledege it is not psbl to give diffrent bulletstyle to each item in a
bulletedlist..still searching for that..

But,If you are using link and want to change the style also, then i
would suggest you to use TreeView..Or you have to find some other
solution.

I will surely let you know if i can find any solution to this. And if
you get solution, then make me inform.. :)

Every problem must has some solution, so don't worry, keep searching..

Regards,
Mansi Shah.
 
K

KSO

You misunderstand my poor english - sorry !

I think my problem in fact is this:

"DisplayMode of the BulletedList is LinkButton and NO MATTER witch value og
the Bulletstyle I choose in the Page_Load, the list looks the same -
If I use "BulletedList1.BulletStyle = BulletStyle.Numbered;" there is STILL
no numbers (only the text) !
"
I think it should look something like this:
1 aaaaaaaaaa
2 bbbbbbb
3 cccccccccc
4 dddddddddd

but it looks like this:
aaaaaaaaaa
bbbbbbb
cccccccccc
dddddddddd

NO NUMBERS - only text - why ?
 
M

Mansi Shah

O O ..

So, for that you make sure that in properties of bulletedlist, just 2
values have been changed (will appear in bold case), first the
BulletStyle and sencond the Displaymode, and you have not applied any
events like 'click' or any other..

Once it displays list properly then u start writing events.

Check this out if there is any problem with this..else you can mail me
your whole code.

Mansi Shah.
 
Ad

Advertisements

K

KSO

My small test project react very strange I think !

I started a new project and here it's works fine - when I place a
BulletedList by "Design view" it can be changed to whatever I want and I can
se the change right away. If I add my code for clicking it changes - just as
I want it to !

If I then take a copy of the BulletedList from the project where it works
and paste it in my original (not working) project - then the BulletedList
changes right away (just after the pasting) to "my problematic" BulletedList
= only text, no LowerAlpha or anything else - as though the form do some
change to the pasted BulletedList - I can't get it !

But never mind - I have the new project that works.

Thanks for your time !

Best regards
KSor, Denmark
 

Top