1 Replies - 719 Views - Last Post: 17 November 2011 - 11:31 PM Rate Topic: -----

#1 iampradeep   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-November 11

how to know if an item is selected in the listview

Posted 17 November 2011 - 11:18 PM

hi all ,
if an item in the listview is seleced then to know if any item is selected ..
I tried using listview1.SelectedItems.Count and listview1.SelectedIndices.Count but everytime it is giving count to 0 after selecting an item ...

thnx ,
Is This A Good Question/Topic? 0
  • +

Replies To: how to know if an item is selected in the listview

#2 HariC   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 16-November 11

Re: how to know if an item is selected in the listview

Posted 17 November 2011 - 11:31 PM

Hi, Just try take following code as an example and try,

To get the selected item of list view, try this:


int index = 0;
if (this.myListView.SelectedItem.Count > 0)
index = this.myListView.SelectedIndices[0]

I hope you will get it.........

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1