Results 1 to 4 of 4

Thread: Adding items to a listview from 3 different textboxes

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    514

    Adding items to a listview from 3 different textboxes

    Hi,
    I just started ASP and thought I could jut convert things Win from win form right to the ASPx.vb and be done

    Here I need help to add rows to a listview I have on my web page. the values are coming form 2 text boxes and a dropdownlist.
    I have searched the net but I all get is data bound approach. I just need to add a few row to the listview based on the user's input also be able to delete a row or two if needed.

    Thanks for the help.

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Adding items to a listview from 3 different textboxes

    You can create a datatable on the fly and then bind it. So it's a "sort of" batabinding.

    https://www.aspforums.net/Threads/50...ase-in-ASPNet/

    Else you can try this but it beats the purpose of the listview and I don't have VS here so I don't know if it will work:

    Code:
    Dim lv as new listviewitem(blah)
    ListView1.Items.Add(lv)
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    514

    Re: Adding items to a listview from 3 different textboxes

    Thanks.
    I would like to avoid datatable if possible.
    so, that "blah" is my texts from 2 different textboxes and the selected item from a dropdownlist?

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Adding items to a listview from 3 different textboxes

    Theoretically is a Listviewitemtype.
    Look here:
    https://docs.microsoft.com/en-us/dot...tframework-4.8
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width