VS 2010 ListView ItemActivate?

Mar 2, 2011

When the ListView's ItemActivate event occurs, how can i get the item that was activated? I tried using the 'sender' in the sub but it returns the ListView, rather than the ListViewItem.

View 2 Replies


ADVERTISEMENT

Forms :: Listview Itemactivate Stops Working?

Dec 23, 2009

I have two forms frmA, frmB. I have a listview on frmA with a couple items with tags. In the listviews Itemactivate event I get the FocusedItem's tag and open frmB. Everything works fine until I close frmB and come back to frmA. The original item is still selected but the Itemactivate no longer opens frmB. I can step right into the frmB.Show line on frmA, it's just that frmB nevers shows.

Private Sub ListView1_ItemActivate(...) Handles ListView1.ItemActivate
Select Case ListView1.FocusedItem.Tag
Case "showfrmB"

[code]....

I've tried adding Hides, Activates, etc. with no luck.

View 4 Replies

C# - ListView ItemActivate Delay Between When The User Clicks The Item And The Event Fires

May 12, 2009

I have a ListView with the Activation property with HotTracking. There appears to be about a 2 second delay between when the user clicks the item and the event fires. Is there a way to get the event to fire immediately upon the user click?

View 2 Replies

VS 2010 Listview Add And Select - Populate A Listview And Leave Selected Records That Are True

Apr 19, 2012

I want to populate a listview and leave selected records that are true

I have a DB record which is ID int, desc varchar, selected boolean.

I have tried the code below

LVProducts is a Listview and DS is a dataset

CODE:

View 3 Replies

VS 2010 - Generating ID To ListView Per Row

Sep 8, 2011

I want is to generate an ID to my listview per row it is possible? For example I have 10 records in listview and I want to add an ID per row in randomly. Here's my sample picture... but it's wrong...coz' at the column 3 it's a repeating ID...

View 1 Replies

VS 2010 : Add Items To Listview?

Sep 23, 2009

I have wrote a code that should write some text in a xml file and add a item for every file in the fileadddialog to the listview. But i can't make it to work, the writing works, both with multi-select and single files. But it only add the Movie to the listview if the file don't exists (read the code to understand).

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
fileaddDialog.ShowDialog()
If DialogResult.OK Then

[code]....

View 2 Replies

VS 2010 Add Items To ListView Not By Row?

Oct 24, 2011

The only way I know how to put an item in a list view is to make a new item, which is the first column, then add a sub item for the columns after that and the item is placed in the row.For this Project I am wondering if there is a way to easily add items to individual cells, based on the column and group, not add items in a row at a time.

Something like the following image is what I need to do with code. To get this I manually added the items in the designer. But the logic bases where to put the class on the other classes in that time block (Mon at 8-1030am is one block). However if we have to add them a row at a time it throws off our logic and thought process.

View 5 Replies

VS 2010 Getting Items In Listview?

Mar 23, 2012

How can I get items in listview? I know how to get the current item if selected but Im trying to put it in a loop where i need to get my three row items there.

I have 3 columns and I want to get there items and insert it in entry string.

This code is wrong

Dim a As Integer = 0
For a = 0 To ListView1.Items.Count
columname.Text = ListView1.FocusedItem.Text(a)

[Code].....

View 3 Replies

VS 2010 Listview Add And Select?

Apr 24, 2010

I know this is going to be an easy question but I cannot figure it out by reading everything I find on google.I want to populate a listview and leave selected records that are true

I have a DB record which is
ID int,
desc varchar,

[code].....

View 13 Replies

VS 2010 Listview Add Range?

Feb 25, 2012

Here is my
Dim ListViewItemArray(-1) As ListViewItem
ReDim Preserve ListViewItemArray(UBound(ListViewItemArray) + 1)

[code].....

View 2 Replies

VS 2010 Listview And Checkbox's

Dec 19, 2011

I have a system which stores fee's paid for a youth teams players.A textfile stores:player name|trainingsessionsattended|amountpaidin..Each line is a new player's entry.I need to make a form that allows the user to input the amount paid by each player at the end of a training session.I did think of doing a single dropdown box and allowing the user to select a user and enter how much he/she paid and entering each players fee's one by one. But this is not practical, considering there are 20 players, this may take a while.I thought of having a listview with every players name and then using this to add the players fee's but am not entirely sure how to go about this.

View 8 Replies

VS 2010 ListView SingleColum?

Jan 12, 2010

the problem is on my listview as soon as it fills up visually it starts on a next line i know in the old vb6 you could do report view, is there somthing simliar to that in .NET?here you can see it moves to another line, all i want is it to stay on a single line for some reason i can't get it to, should be a easy fix or property im over looking.

View 4 Replies

VS 2010 Listview With No Extensions?

Jan 28, 2011

I have my listview showing how I would like but I would like to show it without extensions to the files listed. So when a user dbl clicks the icon it opens in it associated program. Once I take away that extension the dbl click fails as it can't find the file.Is there a better way or easier way to show the files without their extensions and have then still be functional?

View 7 Replies

VS 2010 Synchronizing Two Listview?

Jan 2, 2012

To synchronize a listbox with a listview use the following:

SelectedIndexChanged
Listview1.Items(Listbox1.SelectedIndex).Selected = True
Listview1.Select()

[code].....

View 3 Replies

VS 2010 Treeview And Listview In One?

Mar 6, 2011

i'm looking for a control that is a listview but also acts like a treeview. What I want is f.e.:

+ Item1 description1 information1
-item1b descriptionb informationb
-item1c descriptionc informationc
+ Item2 description2 information2

By clicking on Item1, item1b and 1c must be hidden or showed...

View 5 Replies

VS 2010 - BackgroundWorker And ListView (Improvement)

Jan 7, 2011

Here's my code :
VB
'Clearing the selected items of the listview
ListView1.SelectedItems.Clear()
'Random selection of farms from the listview
Dim random As New Random()
Dim rand As Integer = random.[Next](0, ListView1.Items.Count)
[Code] .....

I'm running it under a BGW and it works fine but is there anyone who can comment on it and make my code a bit better. I've a background worker and I am running it again and again on the RunWorkerCompleted like this
VB
Private Sub BGW_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BGW.RunWorkerComplete
BGW.RunWorkerAsync()
End Sub
Is it bad coding or is there any alternative to run it?

View 6 Replies

VS 2010 - Editable Listview Control ?

Jun 16, 2011

I need a control that will allow me to do a few things.

The control should be similar to Listview in detail mode, in that it lets me show numerous rows, each row with multiple columns. However, I want it editable in place... that is, the user can (if I let him) click on a column and change what is stored there.

The next thing I need to do is set a graphic in one column, text in another, a playback controller in a third, and a trackbar control in the fourth. Every row will look like that.

The final thing I need to do is be able to control how a row is painted... either the entire line or by putting a graphic image (like a button) in a column when it is not being edited.

Barring all of that, I can put all the controls I need into a single user control, then I need some listview-like control that will allow me to add that control to it.. and have it be operational.

I am writing a windows forms application in Visual Studio 10 on Windows 7.

View 5 Replies

VS 2010 - How To Delete ListView Subitems

Apr 27, 2012

I am facing little trouble while deleting the listview subitems. I am also using try and catch method to handle the execption but i am keep on getting it.

The error which I am getting is:
InvalidArgument = Value of '352' is not valid for index
Parameter name: index

Code is given below.
For i = 0 To lstListview.Items.Count - 1
Try
lvi = lstListview.Items.Item(i)
lviSubitem = lvi.SubItems.Item(3).Text
If lviSubitem = "Error" Then
lvi.Remove()
[Code] .....

View 2 Replies

VS 2010 - How To Remove Duplicates In ListView

Jun 7, 2011

Ok, I found some code online on how to do this, but they only compare the Listview.item.text, and they don't care what is in the entire ListViewItem. Is there any code to remove duplicates in a ListView that checks to see if all the subitems are the same as well and THEN removes the entry? [Code]

View 7 Replies

VS 2010 - ListView Delete Item By Name Using VB

Mar 16, 2011

I was just wondering if it was possible to delete an item from a listview just knowing its text name (as in listbox.text) without the need to know the index or have it selected/highlighted? [Code]

View 3 Replies

VS 2010 : ArgumentOutOfRangeException While Populating ListView?

Mar 14, 2011

I'm having this

vb.net
Dim strQuery As String = "SELECT * FROM tblHistory" ' ORDER BY moniDate DESC"
Try
'~~~ Create the connection

[code]....

This is in the Form_Load to populate a ListView control. But I'm getting the following error:

InvalidArgument=Value of '1' is not valid for 'index'.
Parameter name: index

Where am I doing it wrong?

View 10 Replies

VS 2010 : Cannot Get ListView Items To Show

Oct 29, 2011

I've used the same method to add items to a listview before but for some reason they're not showing, I even just tried a test:

Dim row As New ListViewItem
row.Text = "test"
row.SubItems.Add("test")
lstvwHistory.Items.Add(row)

in the load and that doesn't show up.Here is what I am trying:

gameDate = HistoryDS.Tables(0).Rows(0).Item("gameDate")
frmGameHistory.NewGroup(gameDate.ToShortDateString)
For Each row As DataRow In HistoryDS.Tables(0).Rows

[code]....

I walked through the code having a message box pop up every time an item was added with the count and it goes up as it should, nothing throws an error, and the item has all the correct parameters. I commented out the making a new group and just plain add the items and it still didn't show. I tried the lstView in all the kinds of views (detail, small icon, etc.)

View 2 Replies

VS 2010 : Sort Only ONE Column In Listview?

Mar 7, 2011

I want to just sort one column in a listview control. Is this possible or are all the columns tied together?

View 2 Replies

VS 2010 Center Listview Icon?

Feb 7, 2011

I have this code that loads a folder structure in a treeview and then loads icons form that folder structure in a listview. In XP it works good, but in win7 the icon in the listview are right aligned. well it appears they are right aligned. See attached. he icons are set to 31x31

Public Function ListFoldersFiles(ByVal path As String, ByVal lvTemp As ListView, ByVal imgLtemp As ImageList) As String()

[Code]...

View 2 Replies

VS 2010 Copying Listview To Clipboard?

Jun 6, 2011

I googled some code that takes listview contents and puts it into the clipboard, but it doesn't work, when I paste the contents into Excel it looks weird!Here's the code that copies listview contents to clipboard:

Public Sub CopyListViewToClipboard(ByVal lv As ListView)
Dim buffer As New StringBuilder
For i As Integer = 0 To lv.Items.Count - 1

[code]....

The code makes sense to me when I'm trying to see what it's doing but why in the world when I paste the contents into Excel it looks like this:I don't understand...everything is fine when I'm adding new items to the listview and all, but when I click "copy" and then paste it into ms excel this is it how it looks like...

View 2 Replies

VS 2010 Email Hyperlink In ListView?

Sep 22, 2011

I have ListView that displays information about users. One of the fields it displays is the email address. I am wondering if it's possible to have the email address as a clickable "mailto:" hyperlink that will automatically open a new email message when clicked. I haven't found a way to have a hyperlink as a Listview subitem though.

View 7 Replies

VS 2010 Export Data In ListView?

Jun 6, 2011

How can I export everything in my listview? And I want to to export it in parts.

For example if I have 2 colums: Name, Email

I want it to export all the data in those columns as:

Name:
Email:

View 1 Replies

VS 2010 Faster Way To Load A Listview In .NET?

Nov 4, 2010

OK, I've been searching for hours trying to find the best way to fill a listview from a comma delimited file but have come up empty handed so far. Currently I am using code I found on the NET, which works, but it is EXTREMELY slow. As a test, I created a file with 5,000 rows, and 10 columns. The column layout is as follows:123,NAME,NAME,NAME,NAME,0.00,NAME,YEAR,NAME,1

Dim ofd As New StreamReader(".dataCardData.bct")
Try
Using reader As New Microsoft.VisualBasic.FileIO.TextFieldParser(".dataCardData.bct")
reader.TextFieldType = FileIO.FieldType.Delimited
reader.SetDelimiters(",")

[Code]...

The code I am currently using appears to be loading the file and somewhat simultaneously filling the listview at the same time. I feel that I should load the entire file into an array or arraylist and the send the array or arraylist to the listview. However, if this is the best way to do it, I have not been able to find any examples of how to do this.

View 5 Replies

VS 2010 Hide ListView Items?

Nov 6, 2011

I have a listview in details mode with multiple columns. I want to be able to temporarily hide entries. I know the old Listview.Items(x).hide = true doesn't exist (from research).I'm wondering if there's a way to create a temporary list of every item NOT to display, remove them from the listview, then when I want them back, just re add them from the list

View 5 Replies

VS 2010 Listview Column Spacing?

Oct 11, 2011

I have a listview and by default it is set to large icons, no problems there. But if giving the user a choice I would liek to see details in the options. I have it set to switch between icons and details but in details mode there is a lot of spacing in the first column. Image attached. The code is below showing how I am loading the listview. Also why so much vertical spacing as well.

Public Sub ListFoldersFiles(ByVal path As String, ByVal lvTemp As ListView, ByVal imgLtemp As ImageList)

[Code]...

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved