How Do I Avoid Merged Properties in the Property Grid?

Posted by: Imar Spaanjaars at Tuesday, June 29, 2004 11:17:35 AM in: .NET Server Controls

Under normal circumstances, when you select multiple controls on a Web page, the property grid for the designer, like Visual Studio .NET or the Web Matrix, shows an intersection of the properties of the controls you selected. That is, it merges the properties that exist in all the controls and shows them in the grid as one property. This is often very useful as it allows you to quickly set the properties of a lot of controls to the same values, like the font for example.

Read on ...

How Do I Hide the Properties of My Server Control From the Property Grid?

Posted by: Imar Spaanjaars at Tuesday, June 29, 2004 10:27:28 AM in: .NET Server Controls
By default, all properties defined in your control will show up in the property grid when your control is selected in a designer like Visual Studio .NET or the Web Matrix. Often this is exactly what you want, but sometimes it doesn't make sense to have your properties displayed in the grid. For example, a read-only property isn't really useful to display; you should be able to access the property's value using code, but it's not necessary to display it in the grid.
Read on ...

How Do I Debug the Design-Time Support Of My Server Controls?

Posted by: Imar Spaanjaars at Wednesday, June 23, 2004 4:28:05 PM in: .NET Server Controls
Debugging your server controls isn't too difficult. If your control and your consuming Web project are in the same Visual Studio .NET solution, debugging the control is as easy as setting a breakpoint and running your application in Debug mode. Debugging the Design-Time support of your controls is a bit trickier.
Read on ...

How Do I Display a List With Control IDs in a Control's Property?

Posted by: Imar Spaanjaars at Monday, June 21, 2004 5:12:29 PM in: .NET Server Controls
When you're building your own Server Controls you may have the need to hook up one control to another. This is a common practice with the ASP.NET Validator controls, for example. As soon as you drop a validator control on your page, the ControlToValidate drop-down displays a list with controls that can be validated. Adding this behavior to your own server controls is not as difficult as you might think.
Read on ...

How Do I Detect Design-Time Vs Run-Time in a .NET Control?

Posted by: Imar Spaanjaars at Tuesday, May 04, 2004 8:31:13 PM in: .NET Server Controls
When you're designing custom controls in Visual Studio .NET, you'll often need to distinguish between design-time and run-time. You could, for example, load a static image, or create a made-up DataSource at design-time while you use a real image or DataSource at run-time. The following snippet allows you to determine whether you're currently in design-time or not.
Read on ... 1