Vb.Net: Displaying hierarchical name in Label

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simonyong
    New Member
    • Jul 2008
    • 28

    Vb.Net: Displaying hierarchical name in Label

    Hi, everyone I'm newbie to asp.net and currently getting mud with how to display something in label I'm thinking to visualize it: CEO>GM>Manager> Supervisor>Work er

    As example:

    First of all, there is only "CEO"inside Label1 when user click on a "down"button,La bel1 will update into "CEO>GM"

    user click again on "down",Label1wi ll update again into "CEO>GM>Manager " and so on..

    then when user click on "up" button, Label1 will delete the last name in the string

    Ex: CEO>GM>Manager =========> CEO>GM

    Right now, what I had did is only "down" button , but "up" button

    I dont know how to figure it out: Label1.Text = Label1.Text + " > " + e.Item.Cells(1) .Text + " " + e.Item.Cells(2) .Text

    I'm taking name from a datagrid

    Please give me some direction to go, thanks in advance..
  • simonyong
    New Member
    • Jul 2008
    • 28

    #2
    I have an idea, but don't know it can work or not?
    Can anyone tell me more detail or give me the direction to go
    because of i keep it all string in a label
    hence, i use substring to remove what i want
    for example,in CEO>GM>Manager
    i search for substring">Mana ger", then delete it from the string
    but i dont know how to visualize it, can anyone help me?
    thx in advance..

    Comment

    • cloud255
      Recognized Expert Contributor
      • Jun 2008
      • 427

      #3
      If the label already contains a value and you want to remove part of it, it becomes a string manipulation operation. I suggest you look into the String class, ecpecially the String.Remove() method.

      Comment

      • simonyong
        New Member
        • Jul 2008
        • 28

        #4
        Thx lots
        I hav found a way to sole it with using substring to remove it

        Comment

        Working...