472,988 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

collection property and refresh control

Hi,

I have a control which has a collection property.
when an item of the collection property will be added, removed, and so
on, i would like to refresh the control itself.

Usually for that i use eventhandler in the set method of the property.
But as the collection property has only a get method, i'm not able to do
it so.

Therefore, i would like to know how can i do to refresh the parent
control (container) of my collection property when a collection item is
changed ?

thanks a lot,

Al.
Feb 21 '07 #1
3 1443
--== Alain ==-- <no****@noemail.comwrote in news:#7c6ikYVHHA.1036
@TK2MSFTNGP03.phx.gbl:
I have a control which has a collection property.
when an item of the collection property will be added, removed, and so
on, i would like to refresh the control itself.

Usually for that i use eventhandler in the set method of the property.
But as the collection property has only a get method, i'm not able to do
it so.

Therefore, i would like to know how can i do to refresh the parent
control (container) of my collection property when a collection item is
changed ?
If you're using .NET 2.0, take a look at the BindingSource object. If your
controls are bound to a bindingsource object, they'll refresh
automatically.
Feb 21 '07 #2
You have posted this to at least the following newsgroups.

microsoft.public.dotnet.framework.windowsforms.con trols
microsoft.public.dotnet.general
microsoft.public.dotnet.languages.csharp
microsoft.public.dotnet.languages.vb

In the future, if you feel a need to do that, please put all the groups in
the header post them all at once. That way, if someone in one newsgroup
provides an answer, it shows up in all of the groups you posted it in, and
the others know they can spend their time helping someone else.

Thanks,
Robin S.
"--== Alain ==--" <no****@noemail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,

I have a control which has a collection property.
when an item of the collection property will be added, removed, and so
on, i would like to refresh the control itself.

Usually for that i use eventhandler in the set method of the property.
But as the collection property has only a get method, i'm not able to do
it so.

Therefore, i would like to know how can i do to refresh the parent
control (container) of my collection property when a collection item is
changed ?

thanks a lot,

Al.

Feb 21 '07 #3
Therefore, i would like to know how can i do to refresh the parent
control (container) of my collection property when a collection item is
changed ?

If you're using .NET 2.0, take a look at the BindingSource object. If your
controls are bound to a bindingsource object, they'll refresh
automatically.
If you're not using 2.0, you can mimic binding by creating an update
event on the item (raise this event whenever an item property is
changed). Handle this event in the collection by raising another event
there (e.g., ItemUpdated), and handle that event in the control. You
could also have other events to distinguish among what's going on in
the collection:
ItemUpdated - when an item raises its update event
ItemAdded - raised by collection when item is added
ItemRemoved -...
etc.
The control (or whatever is using the collection) can then react with
precision to different activities in the collection.

Feb 21 '07 #4

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

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
1
by: 12jumper | last post by:
Hi All :) I've created an UserControl, which has a couple of properties that are collections (generic lists of some objects). It would be nice, if control refreshed each time I add a new item to...
3
by: --== Alain ==-- | last post by:
Hi, As i did not get any answer to my previous post, i post the topic again. How can i repaint my control, when an item from my custom control collection has changed ? in my collection...
1
by: --== Alain ==-- | last post by:
Hi, I have a control which has a collection property. when an item of the collection property will be added, removed, and so on, i would like to refresh the control itself. Usually for that i...
1
by: --== Alain ==-- | last post by:
Hi, Sorry to open a new post but i still do not have solved my issue with Collection property and i'm really blocked. I have a control which has a collection property. when an item of the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.