473,811 Members | 3,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1472
--== Alain ==-- <no****@noemail .comwrote in news:#7c6ikYVHH A.1036
@TK2MSFTNGP03.p hx.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.publi c.dotnet.framew ork.windowsform s.controls
microsoft.publi c.dotnet.genera l
microsoft.publi c.dotnet.langua ges.csharp
microsoft.publi c.dotnet.langua ges.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******** ********@TK2MSF TNGP03.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
2768
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. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid correctly from the fields on the items object of the collection, but I can't get the DataGrid to...
5
2736
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 the appointment collection to populate the calendar control. The performance getting the XML data is fine, but loading the data into the collection is slow. My question/problem is should I be using the collection, a dataset, or something else to...
2
3187
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 problems that I have encountered to date and the solutions (if any) that I found. http://users.adelphia.net/~brianpclab/ServerControlCollectionIssues.htm This page also has all of the source code in a compressed file that you are free to download...
4
2542
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 Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
19
4924
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 exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
1
2006
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 the collection (using StringCollectionEditor). Is there any attribute I can use, or perhaps I have to create a new class that inherites from List<Tand subscribe on some event? Any suggestions greatly appreciated. Greetings
3
2687
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 property there is only a get function as following :
1
1082
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 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.
1
1341
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 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.
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10405
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.