473,326 Members | 2,148 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,326 software developers and data experts.

Collection issue to refresh control : suite

Hi,

I'm still in trouble with my collection which should refresh my control.
Here is my code extract.

custom Control class code :
....
private ColumnEventHandler HandlerColumnCollectionChanged;
....
/// in constructor
public CARListView()
{
this.HandlerColumnCollectionChanged = new
ColumnEventHandler(OnColumnCollectionChanged);

this.Columns.ColumnAmountChanged += this.HandlerColumnCollectionChanged;
}
....
[Category("Behavior")]
[Browsable(true)]
[Description("Column Collection")]
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
[Editor(typeof(ColumnCollectionEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public ColumnCollection Columns
{
get
{
if (this.m_columns == null)
{
this.m_columns = new ColumnCollection(this);
}
return this.m_columns;
}
}
....
public void OnColumnCollectionChanged(object Sender, ColumnEventArgs e)
{
this.Invalidate();
}
in my ColumnCollection class, i have the following code :
public event ColumnEventHandler ColumnAmountChanged;
public int Add(Column column)
{
if (column == null)
{
throw new System.ArgumentNullException("Column is null");
}

int index = this.List.Add(column);
this.RecalcWidthOfAllColumns();
this.OnColumnAmountChanged(new ColumnEventArgs(column, index,
ColumnEventType.ColumnAdded, null));

return index;
}
....
protected virtual void OnColumnAmountChanged(ColumnEventArgs e)
{
if (ColumnAmountChanged != null)
{
ColumnAmountChanged(this, e);
}
}
....

So everytime that a column is added, it should raise the event
ColumnAmountChanged. This event should be caught by
OnColumnCollectionChanged handler method, but it is not true.

So where could be the problem ?

thanks a lot,

Al.
Feb 23 '07 #1
0 869

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....
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...
9
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't...
0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.