473,569 Members | 3,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Property change does not refresh custom control

Hi,

I have a custom control in which i have a property based on
CollectionBase class.

like the following one :
//------- XGrid.cs file --------------//
[Category("Behav ior"),
Browsable(true) ,
Description("Co lumn Collection"),
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
public ColumnsCollecti on Columns
{
get
{
if (this.m_Columns == null)
{
this.m_Columns = new ColumnsCollecti on(this);
}
return this.m_Columns;
}
}
protected internal virtual void OnColumnAdded(C olumnsCollectio nEventArgs e)
{
this.Invalidate (); // <- this does not refresh the control on design
time :-(

if (ColumnAdded != null)
{
ColumnAdded(thi s, e);
}
}

//------- ColumnsCollecti on.cs file --------------//

this collection (named Columns) is as the following :

public class ColumnsCollecti on : CollectionBase
{
....
public ColumnsCollecti on(XGrid owner): base()
{
if (owner == null)
{
throw new ArgumentNullExc eption("owner") ;
}

this.m_owner = owner;
}

public void Add(Column column)
{
if (column == null)
{
throw new System.Argument NullException(" Column is null");
}
int index = this.List.Add(c olumn);
this.Recalculat eTotalWidth();
this.OnColumnAd ded(new ColumnEventArgs (column, this.IndexOf(co lumn),
ColumnEventType .ColumnAdded, null));
}
....
protected virtual void OnColumnAdded(C olumnEventArgs e)
{
this.m_owner.On ColumnAdded(e);
}
....
}

unfortunatelly, my control is not refresh automatically when i add a new
column to the Columns Property.
i have the same issue with removing column.

any idea ?
thanks a lot,

RAF
Oct 13 '07 #1
3 4748
hello,
This may help
http://www.vbdotnetheaven.com/Upload...toRefresh.aspx

regards,
Husam Al-A'araj
www.aaraj.net

"R.A.F." wrote:
Hi,

I have a custom control in which i have a property based on
CollectionBase class.

like the following one :
//------- XGrid.cs file --------------//
[Category("Behav ior"),
Browsable(true) ,
Description("Co lumn Collection"),
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content)]
public ColumnsCollecti on Columns
{
get
{
if (this.m_Columns == null)
{
this.m_Columns = new ColumnsCollecti on(this);
}
return this.m_Columns;
}
}
protected internal virtual void OnColumnAdded(C olumnsCollectio nEventArgs e)
{
this.Invalidate (); // <- this does not refresh the control on design
time :-(

if (ColumnAdded != null)
{
ColumnAdded(thi s, e);
}
}

//------- ColumnsCollecti on.cs file --------------//

this collection (named Columns) is as the following :

public class ColumnsCollecti on : CollectionBase
{
....
public ColumnsCollecti on(XGrid owner): base()
{
if (owner == null)
{
throw new ArgumentNullExc eption("owner") ;
}

this.m_owner = owner;
}

public void Add(Column column)
{
if (column == null)
{
throw new System.Argument NullException(" Column is null");
}
int index = this.List.Add(c olumn);
this.Recalculat eTotalWidth();
this.OnColumnAd ded(new ColumnEventArgs (column, this.IndexOf(co lumn),
ColumnEventType .ColumnAdded, null));
}
....
protected virtual void OnColumnAdded(C olumnEventArgs e)
{
this.m_owner.On ColumnAdded(e);
}
....
}

unfortunatelly, my control is not refresh automatically when i add a new
column to the Columns Property.
i have the same issue with removing column.

any idea ?
thanks a lot,

RAF
Oct 13 '07 #2
Hi,

Unfortunatelly it does not help me.

Basically my problem is when i change this COlumns property, my control
does not update/refresh to show those changes... but if i change another
property, it refresh perfectly the control and shows changes performed
by Columns property :-(

so something must be wrong with this Columns property refreshing....b ut
what ?

RAF

Husam Al-A''araj wrote:
hello,
This may help
http://www.vbdotnetheaven.com/Upload...toRefresh.aspx

regards,
Husam Al-A'araj
www.aaraj.net

"R.A.F." wrote:
>Hi,

I have a custom control in which i have a property based on
CollectionBa se class.

like the following one :
//------- XGrid.cs file --------------//
[Category("Behav ior"),
Browsable(true) ,
Description("Co lumn Collection"),
DesignerSerial izationVisibili ty(DesignerSeri alizationVisibi lity.Content)]
public ColumnsCollecti on Columns
{
get
{
if (this.m_Columns == null)
{
this.m_Columns = new ColumnsCollecti on(this);
}
return this.m_Columns;
}
}
protected internal virtual void OnColumnAdded(C olumnsCollectio nEventArgs e)
{
this.Invalidate (); // <- this does not refresh the control on design
time :-(

if (ColumnAdded != null)
{
ColumnAdded(thi s, e);
}
}

//------- ColumnsCollecti on.cs file --------------//

this collection (named Columns) is as the following :

public class ColumnsCollecti on : CollectionBase
{
....
public ColumnsCollecti on(XGrid owner): base()
{
if (owner == null)
{
throw new ArgumentNullExc eption("owner") ;
}

this.m_owner = owner;
}

public void Add(Column column)
{
if (column == null)
{
throw new System.Argument NullException(" Column is null");
}
int index = this.List.Add(c olumn);
this.Recalculat eTotalWidth();
this.OnColumnAd ded(new ColumnEventArgs (column, this.IndexOf(co lumn),
ColumnEventTyp e.ColumnAdded, null));
}
....
protected virtual void OnColumnAdded(C olumnEventArgs e)
{
this.m_owner.On ColumnAdded(e);
}
....
}

unfortunatelly , my control is not refresh automatically when i add a new
column to the Columns Property.
i have the same issue with removing column.

any idea ?
thanks a lot,

RAF
Oct 14 '07 #3
ok, i finally found how to refresh my control when a collection property
is updated and i do not see it as really LOGICAL. :-(

basically, i needed to create a special property editor for this
collection property and into the overridden function EditValue, i placed
control.refresh ();

this force my control to redraw when i add or remove a column from this
collection property.

Why a simple invalidate() into the add or remove functions (from my
collection class) does not work ? this is a mystery for me.

Any idea ?

RAF

R.A.F. wrote:
Hi,

Unfortunatelly it does not help me.

Basically my problem is when i change this COlumns property, my control
does not update/refresh to show those changes... but if i change another
property, it refresh perfectly the control and shows changes performed
by Columns property :-(

so something must be wrong with this Columns property refreshing....b ut
what ?

RAF

Husam Al-A''araj wrote:
>hello,
This may help
http://www.vbdotnetheaven.com/Upload...toRefresh.aspx
regards,
Husam Al-A'araj
www.aaraj.net

"R.A.F." wrote:
>>Hi,

I have a custom control in which i have a property based on
CollectionBas e class.

like the following one :
//------- XGrid.cs file --------------//
[Category("Behav ior"),
Browsable(true) ,
Description("Co lumn Collection"),
DesignerSeria lizationVisibil ity(DesignerSer ializationVisib ility.Content)]

public ColumnsCollecti on Columns
{
get
{
if (this.m_Columns == null)
{
this.m_Columns = new ColumnsCollecti on(this);
}
return this.m_Columns;
}
}
protected internal virtual void
OnColumnAdded (ColumnsCollect ionEventArgs e)
{
this.Invalidate (); // <- this does not refresh the control on
design time :-(

if (ColumnAdded != null)
{
ColumnAdded(thi s, e);
}
}

//------- ColumnsCollecti on.cs file --------------//

this collection (named Columns) is as the following :

public class ColumnsCollecti on : CollectionBase
{
....
public ColumnsCollecti on(XGrid owner): base()
{
if (owner == null)
{
throw new ArgumentNullExc eption("owner") ;
}

this.m_owner = owner;
}

public void Add(Column column)
{
if (column == null)
{
throw new System.Argument NullException(" Column is null");
}
int index = this.List.Add(c olumn);
this.Recalculat eTotalWidth();
this.OnColumnAd ded(new ColumnEventArgs (column,
this.IndexOf( column), ColumnEventType .ColumnAdded, null));
}
....
protected virtual void OnColumnAdded(C olumnEventArgs e)
{
this.m_owner.On ColumnAdded(e);
}
....
}

unfortunatell y, my control is not refresh automatically when i add a
new column to the Columns Property.
i have the same issue with removing column.

any idea ?
thanks a lot,

RAF
Oct 15 '07 #4

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

Similar topics

0
1026
by: Earl Bonovich | last post by:
This is a repost from my question in the buildcontrol sub group. ---------------- I have created a composite custom control. It works fine, renders, all is good on that side. I am trying to cleaup the design mode side of it, and in turn clean up the core control. All surounding properties.
4
1411
by: Job Lot | last post by:
I have implemented DashStyle and LineThickness for custom circle control as follows: Public Property DashStyle() As DashStyle Get Return m_DashStyle End Get Set(ByVal Value As DashStyle) m_DashStyle = Value End Set
13
2064
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does overflow. All I know is that the program is either stopped due to an exception at the end of Main or has exited after the Stack Overflow exception....
4
2026
by: DraguVaso | last post by:
Hi, I'm having some weird behaviour, and I can't find any solution to this. I made a UserControl (uclCommands) which contains a Toolbar (ToolBar1) with Modifiers = Public. I put this usercontrol on my form and call it Ucl1. In the Property Window in the Windows Forms Designer I change Ucl1.ToolBar1.ButtonSize to a bigger value.
0
888
by: greekgoddj | last post by:
Hello, I have been implementing IAccessible to my custom ATl based ActiveX Controls. When any of the arrow keys are pressed, I change the value of my control, set the new value to ACC_VALUE and call "NotifyWinEvent(EVENT_OBJECT_VALUECHANGE, m_hWnd, OBJID_CLIENT, 0);" so that any accessible client such as a screen reader can read out the new...
7
2977
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
5552
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control is used to view the state of the running jobs and schedule new jobs. The control also runs in the context of Internet Explorer (we do this so the...
0
3244
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design time. If I type the code in the aspx manually it does get parsed correctly though. This is an example of the aspx code that gets parsed...
1
2356
by: --== Alain ==-- | last post by:
Hi, I have some issue with my custom control. When i change my property "GridLine.Color" my custom control should redraw its border with the specified color. However, nothing happens. therefore based on an example from a book i implemented an eventhandler and tried to manage it like that... but still nothing. Here is my code example :
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
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...
0
7983
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...
1
5514
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...
0
3662
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
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...

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.