in

dotNetFreak

Ramblings & Controls from a .NET Addicted Freak!

Kevin Gearing's Blog

DefaultValue and String Arrays

Whilst creating a custom ASP.NET control I've come across a slight problem, namely the DefaultValue attribute and arrays...

One of the properties of the control accepts a string array, but I can't for the life of me figure out how you set the DefaultValue to an array containing fixed values. I've tried just about every combination I can think of, all with no joy.

I can obviously set the initial value when displayed in the designer by assigning the property a value from Public Sub New(), but I want to be able to 'Reset' the value (and avoid it being bold). As a workaround I've created a 'Resetxxxx' method which does reset the value when reset is clicked whilst right-clicking over the property in design mode, but doesn't remove the bold highlighting.

If anyone knows how to use arrays with the DefaultValue attribute, please let me know.

Published Oct 24 2004, 05:41 PM by dotNetFreak
Filed under:

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  

Protected by FormShield
Refresh
Listen
Please enter the characters shown on the image


Code:


Add
Shopbot
Shopbot

 

 

Copyright ©2004-2007 Kevin Gearing. All Rights Reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems