0

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

apple            from database
orange                "
banana                "

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

I am using C# ,visual studio..

1 Answer 1

1

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

ItemCollection.Items.Add(item);

Then bind the collection to your control

ListView.DataSource = ItemCollection;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.