473,512 Members | 15,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What event am I supposed to use?

TJ
Hi

I placed one ListView control on a form
I would like to check how many items in the ListView control as real-time
In other words, whenever total item count of ListView control is chagend, I would like to get some notify so that I can do something...

For example, whenever add or remove operation is performed, event would be fired....
What event am I supposed to use for this one

Thanks

.................................................. ....................T
Nov 16 '05 #1
3 1347
TJ,

I would recommend limiting access to the list, and providing your own
methods for adding the items that are being shown by the ListView. This
way, you can know when items are being added or removed.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"TJ" <an*******@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hi,

I placed one ListView control on a form.
I would like to check how many items in the ListView control as real-time.
In other words, whenever total item count of ListView control is chagend, I would like to get some notify so that I can do something....
For example, whenever add or remove operation is performed, event would be fired..... What event am I supposed to use for this one?

Thanks.

.................................................. ...................TJ

Nov 16 '05 #2
TJ
Thanks, Nicholas

I am just curious that..
Is there any supported event that I can use for checking of item number in ListView control
Something like this..

ListView.ItemCountChanged += new ItemCountChangedEventHandler(OnItemCountChanged)

private void OnItemCountChanged(......Event e)
MessageBox.Show(e.TotalCount); // TotalCount would be number of items in ListView in real-time so that I do not need to keep track variable for checking number of items in ListView control..
Thanks

.................................................. .......TJ
Nov 16 '05 #3
TJ,

No, there is not. You could override the WndProc method and check for
the LVM_DELETEITEM and LVM_INSERTITEM windows messages.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"TJ" <an*******@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
Thanks, Nicholas.

I am just curious that...
Is there any supported event that I can use for checking of item number in ListView control? Something like this...

ListView.ItemCountChanged += new ItemCountChangedEventHandler(OnItemCountChanged);
private void OnItemCountChanged(......Event e) {
MessageBox.Show(e.TotalCount); // TotalCount would be number of items in ListView in real-time so that I do not need to keep track variable
for checking number of items in ListView control... }

Thanks.

.................................................. ......TJ

Nov 16 '05 #4

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

Similar topics

2
2099
by: Mike | last post by:
I have a textbox where I'm trying to restrict which keys a user can hit. My syntax is onKeyDown="myFunction(event)" To restrict the keys, Netscape requires the event.preventDefault method. ...
3
1895
by: Alexander | last post by:
I have a dialog that loads a file from a web server, this is done in an own thread. On finish or failure the thread is supposed to raise an event notifying the dialog. If the WebRequest now raises...
7
3247
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically...
2
2798
by: George | last post by:
I'm having a weird problem. When I double-click a Web server control that I have on my design-time Web form, such as a button, it puts the event handler in the Code Behind as a Private Sub...
4
2108
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
11
2804
by: OldProgrammer | last post by:
All the documentation and discussion I have read indicate that the Session_End is not supposed to fire unless you are in "inProc" Session state mode, and then only on Session Timeout or at Session...
5
1314
by: Simon Verona | last post by:
I have an inherited datagrid which has a "double-click" even which returns the row that has been clicked on - this can be consumed by the form (etc) that hosts the control to open another window...
6
2559
by: Mark Chambers | last post by:
Hi there, Does anyone know why the "ColumnChanged" event isn't fired when "Merge()" is called below. "OnRowChanged()" is fired however: Thanks in advance. private static void Test() {...
3
2356
by: Lars Uffmann | last post by:
I have this wxWidgets OnButtonClick event handler, that apparently holds a lock on all widgets in my form, but this event handler is supposed to end a thread in the background - while that thread...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
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
7432
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...
1
7093
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
7517
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...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.