![]() |
| ||
| ListView Small Probs ListView Properties- I set MultiSelect to False, LabelEdit to true,FullRowSelect to True. I have Listview with two columns. 1) When I select onw row in listview,On button click i want to get the index of selected row. I m getting it but using for loop,I want to know is there a way to know the index of selected row,Without using the for loop. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 2) On Listview, double click,i want to edit the items of listview. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load When we double click on first row, 1 comes to edit mode, i want to know i want that second column text comes to edit mode.. So i write ListView1.SelectedItems(1).BeginEdit() But Error is there- InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index Can somebody tell me how to edit the second column text. |
| ||
| Re: ListView Small Probs ListView1.SelectedItems(1).BeginEdit()cant worrk out. You have multiselect set to false so there is always only one item selected. so it have to stick on 0. remember ListView1.SelectedItems(1) doesnt mean its the next item in list, its the next selected item (which doesnt exist on multiselect=False) |
| ||
| Re: ListView Small Probs 1) since multiselect is false listview1.selecteditems(1) is not possible it has to be listview1.selecteditem(0) since u want a particular column add another parameter. listview1.selecteditem(0)(1) this should fetch the second row. this is just like a 2 dimensional array or a matrix. first parameter is the row and the second parameter is the column |
| All times are GMT -4. The time now is 5:36 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC