c# - Pulling an item from listview -
I am trying to pull a value from a listview and display it in a label. If I wanted to draw "Data three" from the first item, then I was trying the following:
Private zeros frmNotifications_Load (Object Sender, EventArgs) {Settings.Items.Clear (); ListViewItem Item = New ListViewItem ("First item"); Item.SubItems.Add ("Data One"); Item.SubItems.Add ("Data Two"); Item.SubItems.Add ("Data Three"); Item.SubItems.Add ("Data Four"); Settings.Items.Add (item); ListViewItem Item = New ListViewItem ("Second Item"); Item.SubItems.Add ("Data One"); Item.SubItems.Add ("Data Two"); Item.SubItems.Add ("Data Three"); Item.SubItems.Add ("Data Four"); Settings.Items.Add (item); LblData.text = Settings.GetItemAt (1, 4). Text; }
My last row is not set back for
Actually get the value of the "text" information for the item, what you want to do, it can be obtained by:
var newVariable = ListView1.Items [1] .SubItems [1]. Text
Comments
Post a Comment