BulletedList Control

Discussion in 'ASP .Net Web Controls' started by KSO, Oct 17, 2007.

  1. KSO

    KSO Guest

    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 ?
     
    KSO, Oct 17, 2007
    #1
    1. Advertising

  2. KSO

    KSO Guest

    Oh - I forgot - it doesn't change the displaymode at all !

    "KSO" wrote:

    > 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 ?
    >
     
    KSO, Oct 17, 2007
    #2
    1. Advertising

  3. KSO

    KSO Guest

    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 ?


    "KSO" wrote:

    > 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 ?
    >
     
    KSO, Oct 18, 2007
    #3
  4. KSO

    KSO Guest

    RE: BulletedList Control SORRY SORRY !

    It's the BULLETSTYLE I'm trying to change - not Displaymode - sorry !

    "KSO" wrote:

    > 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 ?
    >
     
    KSO, Oct 18, 2007
    #4
  5. KSO

    Mansi Shah Guest

    RE: BulletedList Control SORRY SORRY !

    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.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mansi Shah, Oct 18, 2007
    #5
  6. KSO

    KSO Guest

    RE: BulletedList Control SORRY SORRY !

    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 ?


    "Mansi Shah" wrote:

    >
    > 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.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    KSO, Oct 18, 2007
    #6
  7. KSO

    Mansi Shah Guest

    RE: BulletedList Control SORRY SORRY !

    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.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mansi Shah, Oct 18, 2007
    #7
  8. KSO

    KSO Guest

    RE: BulletedList Control SORRY SORRY !

    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






    "Mansi Shah" wrote:

    >
    > 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.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    KSO, Oct 18, 2007
    #8
  9. KSO

    Mansi Shah Guest

    RE: BulletedList Control SORRY SORRY !

    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.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mansi Shah, Oct 18, 2007
    #9
  10. KSO

    KSO Guest

    RE: BulletedList Control SORRY SORRY !

    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 ?



    "Mansi Shah" wrote:

    >
    > 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.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    KSO, Oct 18, 2007
    #10
  11. KSO

    Mansi Shah Guest

    RE: BulletedList Control SORRY SORRY !

    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.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mansi Shah, Oct 19, 2007
    #11
  12. KSO

    KSO Guest

    RE: BulletedList Control SORRY SORRY !

    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

    "Mansi Shah" wrote:

    >
    > 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.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    KSO, Oct 21, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stan SR

    BulletedList inside BulletedList

    Stan SR, Aug 31, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,884
    Stan SR
    Aug 31, 2006
  2. Nathan Sokalski

    Nesting the BulletedList control

    Nathan Sokalski, Mar 13, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    610
    Nathan Sokalski
    Mar 13, 2007
  3. Nathan Sokalski

    Problem with the BulletedList control

    Nathan Sokalski, Mar 15, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    361
    Nathan Sokalski
    Mar 15, 2007
  4. Rob R. Ainscough

    BulletedList control not showing bullets?

    Rob R. Ainscough, May 23, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    295
    Rob R. Ainscough
    May 23, 2006
  5. Nathan Sokalski

    Nesting the BulletedList control

    Nathan Sokalski, Mar 13, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    158
    Nathan Sokalski
    Mar 13, 2007
Loading...

Share This Page