listview and datagrid
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts
Page 1 of 1
Hello,
does anyone knowns how to get the last 3 records from a listview and a datagrid.
i want to get the second and the third column
to show in a label.
and the records don't need to select first
just read it when i load it.
anyone?
not show the last 3 :(
does anyone knowns how to get the last 3 records from a listview and a datagrid.
i want to get the second and the third column
to show in a label.
and the records don't need to select first
just read it when i load it.
anyone?
Code: Select all
this code just take the last row but this duplicate the record If i Mod 2 = 0 Then
Label27.Text = lstView.Items(i).SubItems(2).Text
Label4.Text = lstView.Items(i).SubItems(2).Text
Label31.Text = lstView.Items(i).SubItems(2).Text
End If
not show the last 3 :(
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
:( nobody?
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
To get the second and third column you can use this
Code: Select all
If i Mod 2 = 0 Then
Label27.Text = lstView.Items(i).SubItems(0).Text & " " & lstView.Items(i).SubItems(1).Text
Label4.Text = lstView.Items(i).SubItems(0).Text & " " & lstView.Items(i).SubItems(1).Text
Label31.Text = lstView.Items(i).SubItems(0).Text & " " & lstView.Items(i).SubItems(1).Text
End If
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

sorry m8
but this don't change anything
i still get the same record 3x :(
but this don't change anything
i still get the same record 3x :(
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
What do you mean? The code you gave is designed to put the same record into three different labels :?
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

well i need the last 3 records from the column 2 and 3
and show it in those labels.
like i said i got only the last record with my code
but i get 3x the same record.
and show it in those labels.
like i said i got only the last record with my code
but i get 3x the same record.
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Code: Select all
Maybe get like that ?Label27.Text = lstView.Items(lstView.Items.count-3).SubItems(2).Text
Label4.Text = lstView.Items(lstView.Items.count-2).SubItems(2).Text
Label31.Text = lstView.Items(lstView.Items.count-1).SubItems(2).Text
hello m1z
i have checked it again and it works.
thanks m8 +rep for you :lol:
i have checked it again and it works.
thanks m8 +rep for you :lol:
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023