Forum
Notifications
Clear all
23/05/2018 12:43 pm
I Friends,
I am trying to get the data of a listview controls all column data to textboxes. My code is as below.
this.Text1.Text = this.listview1.SelectedItems[0].Text; this.Text2.Text = this.listview1.SelectedItems[1].Text;
this.Text3.Text = this.listview1.SelectedItems[2].Text;
I get the error :
InvalidArgument=Value of '0' is not valid for 'index'.\r\nParameter name: index
Please help me to solve this issue.
24/05/2018 1:33 pm
Hi,
Please use the below code :
this.Text1.Text = this.listview1.SelectedItems[0].SubItems[0].Text;
this.Text2.Text = this.listview1.SelectedItems[0].SubItems[2].Text;
this.Text3.Text = this.listview1.SelectedItems[0].SubItems[3].Text;
I hope this will help you.
Thanks
sels2005j liked
25/05/2018 10:47 am
Hi,
Please use the below code :
this.Text1.Text = this.listview1.SelectedItems[0].SubItems[0].Text;
this.Text2.Text = this.listview1.SelectedItems[0].SubItems[2].Text;
this.Text3.Text = this.listview1.SelectedItems[0].SubItems[3].Text;I hope this will help you.
Thanks
Thank you very much.
It solved my issue.