Adagio
Well-known member
- Joined
- Dec 12, 2005
- Messages
- 162
- Programming Experience
- Beginner
Anybody who has any idea on what to do here?
When I try to set an item to be selected programmatically, I have noticed that is only visually it is selected. If I set an item to be selected and clicks on the arrow down key, the listview seems to think that it is the first item in the listview which is selected and thereby it selects the item at index 1, nomatter what index I have selected
I have noticed that both dgvDamageReports.SelectedIndices.Count and dgvDamageReports.SelectedItems.Count returns 0, even though when I look at the Selected property on the item I have selected, it clearly returns true
I have the following code: (multiselect is set to false)
lstDamageReports is a normal ListView. I have tried googling for a solution for the problem, but so far no luck
When running the above code, the watch window says the following:
An item is clearly selected, but the ListView can't see that it is. Anybody who has any idea on what to do here?
When I try to set an item to be selected programmatically, I have noticed that is only visually it is selected. If I set an item to be selected and clicks on the arrow down key, the listview seems to think that it is the first item in the listview which is selected and thereby it selects the item at index 1, nomatter what index I have selected
I have noticed that both dgvDamageReports.SelectedIndices.Count and dgvDamageReports.SelectedItems.Count returns 0, even though when I look at the Selected property on the item I have selected, it clearly returns true
I have the following code: (multiselect is set to false)
VB.NET:
lsvDamageReports.Items(3).Focused = True
lsvDamageReports.Items(3).Selected = True
lsvDamageReports.Items(3).EnsureVisible()
lsvDamageReports.Select()
lstDamageReports is a normal ListView. I have tried googling for a solution for the problem, but so far no luck
When running the above code, the watch window says the following:
VB.NET:
lsvDamageReports.Items(3).Selected = True
dgvDamageReports.SelectedItems.Count = 0
An item is clearly selected, but the ListView can't see that it is. Anybody who has any idea on what to do here?