0

I have a listview that is bind with datasource. In this listview i have to insert a hardcode value (Add new..) and a button at 0 index of listview.

Can anyone help that how can i insert a value and button at 0 index of listview.

Thanks in advance.

2 Answers 2

1

You cannot insert values while your control is bound to a data source. You will have to find a way to include the value in your data source at the zeroth position and then rebind it to your control, or you could abandon the idea of using a data source and instead populate the control's items manually.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok.Thanks for your suggestion roryap
0

you can insert value into zeroth position to a bounded ListView as Below:

Dim newItem As New ListViewItem
newItem.Text = "Value To Display"
ListView1.Items.Insert(0, newItem)

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.