473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

listView + events

How come there isn't an event handler for when an item or subitem of a
listview changes?

Nov 20 '05 #1
2 1089
* Won Lee <no*****@nospam.com> scripsit:
How come there isn't an event handler for when an item or subitem of a
listview changes?


Subitems cannot edited directly by the user, so there is no need for
such an event. As a programmer, you should know yourself when you
change the text if a subitem.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
> Subitems cannot edited directly by the user, so there is no need for
such an event. As a programmer, you should know yourself when you
change the text if a subitem.


Ahh ok. That makes sense. Except I have need to call a method which
calls another form. It works fine when I call the methods in any other
method but specific datastream handler that I'm using. I can't actually
see the code for the datastream event handler because I'm referencing a
DLL.

I'm not sure why it's happening. It doesn't seem to be fixable from my
side. I need to move the method call to another part of the app. I was
hoping that I could add an event handler on the subitems but that
doesn't seem to work. I did try to also select the item when I add the
subitem.

Dim li As ListViewItem

ListView1.SelectedItems.Clear()
For Each li In ListView1.Items
If li.Text = symbol Then
li.SubItems.Add("X")
li.Selected = True
Console.WriteLine("selected: " & li.Text)
Exit For
End If
Next li
Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Console.WriteLine("selectedIndexChanged1")
Try
Console.WriteLine("subitem" &
ListView1.SelectedItems.Item(0).SubItems(0).Text)
If ListView1.SelectedItems.Item(0).SubItems(0).Text = "X" Then
Console.WriteLine(ListView1.SelectedItems.Item(0). Text)

Console.WriteLine(ListView1.SelectedItems.Item(0). SubItems(0).Text)
CallAlertBox(ListView1.SelectedItems.Item(0).Text)
End If

Catch ex As Exception
Console.WriteLine(ex)
End Try

End Sub

But I'm getting an array out of bounds error

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add...
2
by: Aaron Queenan | last post by:
Is there any way to know whether the OnItemCheck is being called in response to a user action (mouse or keyboard) as opposed to the form loading? I have a class which derives from...
7
by: Dave Y | last post by:
I am a newbie to C# and am having trouble trying to override a ListView property method. I have created a new class derived from the Forms.Listview and I cannot figure out the syntax to override...
1
by: Tim | last post by:
I have successfully captured the scroll event of the listview control by creating a class that inherits the list view control then overriding the wndproc procedure. I have two questions though....
1
by: Dean Slindee | last post by:
The listview events "ItemSelectionChanged" and "SelectedIndexChanged" events appear to both fire when someone clicks on a different item in a listview. Is there some reason to use one event over...
6
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
5
by: Mark Olbert | last post by:
How do I get the DataPager and ListView to play nice together when I use a custom datasource? In my webpage, I use linq to pull data from a SqlServer database and assign the resulting...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
2
by: John | last post by:
I'm calling the Webmethod from JS and at the end of the function I would like to do a a ListViewBillable.DataBind() in the Webmethod, calling a postback from JS is not rendering the correct...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.