How to add listview items in C#

Total Post:154


 2205  View(s)
Rate this:
Hi mindstick!

Hello I have some doubts in listveiw I have a listview with two columns, i want to add items to the first column which are given programmatically and the other column is from database... like

column1              column2

abc            from database

def                   "

 hij                    "

can this be done.... can any one help me out with this...

I am using C# ,visual studio........

thanks  in advance

  1. Re: How to add listview items in C#


    I'm not sure how you want to match the programmatically added values and the db values, but you could create a new listitem for each of the database values i.e.

    ListItem item = new ListItem("apple",[database value]);

    Add the items to a collection


    Then bind the collection to your control

    ListView.DataSource = ItemCollection;


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.