PC Review


Reply
Thread Tools Rate Thread

Collection property does not update control

 
 
--== Alain ==--
Guest
Posts: n/a
 
      18th Feb 2007
Hi,

I have a collection property in my custom control like this one :

[Category("Behavior")]
[Browsable(true)]
[Description("Column Collection")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.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;
}
}

it works very well, except one thing.

When the number of columns increase or decrease, it should redraw/update
the control, but nothing occurs.
I have to click somewhere on the form to update the control.

I tried to use eventhandlers, but where to use them when there is not
"set" in this property ?

I tried to add them in my ColumnCollection class where is the method to
add column and into the method to remove a column, but nothing worked.

Any ideas ?

thx.

Al.
 
Reply With Quote
 
 
 
 
--== Alain ==--
Guest
Posts: n/a
 
      19th Feb 2007
nobody has an idea ?

--== Alain ==-- wrote:
> Hi,
>
> I have a collection property in my custom control like this one :
>
> [Category("Behavior")]
> [Browsable(true)]
> [Description("Column Collection")]
> [DesignerSerializationVisibility(DesignerSerializationVisibility.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;
> }
> }
>
> it works very well, except one thing.
>
> When the number of columns increase or decrease, it should redraw/update
> the control, but nothing occurs.
> I have to click somewhere on the form to update the control.
>
> I tried to use eventhandlers, but where to use them when there is not
> "set" in this property ?
>
> I tried to add them in my ColumnCollection class where is the method to
> add column and into the method to remove a column, but nothing worked.
>
> Any ideas ?
>
> thx.
>
> Al.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection property and control owner R.A.F. Microsoft C# .NET 2 17th Oct 2007 08:30 AM
collection property and refresh control --== Alain ==-- Microsoft VB .NET 3 21st Feb 2007 09:21 PM
Can't get collection to save when using collection of custom class as property of control in VS 2005 J.Edwards Microsoft Dot NET Compact Framework 0 10th Jan 2006 04:44 AM
Collection Property Web Custom Control Chris Calzaretta Microsoft VB .NET 0 28th Feb 2005 04:10 PM
ASP.NET Custom control with collection property -=Chris=- Microsoft ASP .NET 2 23rd May 2004 07:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:50 PM.