Version Fran├žaise
Search Stories : Publier Votre Article
> Constructor of type system.string not found (Design Time error) <
Published on 4/12/2008 By Malek Chtioui (Xcess)
When using a property grid in a .NET project (with custom server controls too) the message constructor of type system.string not found can occur on the design mode.

To solve that, add this line on the top of your property :

[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]

Exemple :
       
        private System.Collections.Generic.List<string> _Ilist;

        [Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
        public System.Collections.Generic.List<string> Files_List
        {
            get
            {
                return _Ilist;
            }
            set
            {
                _Ilist = value;
            }
        }
 Comments : Publish your article
re: Constructor of type system.string not found
By Fred, Date: 4/12/2008
does anybody know how to have a property that contains a list of files (with the browse '...' at design time)
Re: fred
By Xcess (malek), Date: 4/12/2008
Hello, yes Fred :

[PersistenceMode(PersistenceMode.InnerProperty), DefaultProperty("FileName")]
public class File
{
public File()
{
}

public File(string File_Name)
{
FileName = File_Name;
}

private string _fname = "";

[Bindable(true)]
[DefaultValue("")]
[Localizable(true)]
[Editor(typeof(System.Web.UI.Design.UrlEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string FileName
{
get { return _fname; }
set { _fname = value; }
}
}

public class MM_FileNames : CollectionBase
{
public File this[int index]
{
get { return ((File)(List[index])); }
set { List[index] = value; }
}
public int Add(File item)
{
return List.Add(item);
}

public void Insert(int index, File item)
{
List.Insert(index, item);
}
}


use MM_FileNames in your class as a public property like this :


private MM_FileNames _XFN = new MM_FileNames();
[NotifyParentProperty(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public MM_FileNames Files_List
{
get { return _XFN; }
}
Inforamtion is power and now I'm a !@#$ing dictator.
By Inforamtion is power and now I'm a !@#$ing dictato, Date: 4/2/2012
Inforamtion is power and now I'm a !@#$ing dictator.
https://u4fifa.wordpress.com/
By u4fifa, Date: 6/5/2016
I do not know
https://www.webwiki.com/u4fifa.com
By u4fifa reviews, Date: 6/22/2016
You are looking sharp !
 Add your Comment :
Your Name :
Email :
   * Email address will be hidden.
Title :
Comment :
Other articles
How to send templated emails in Asp.Net 2.0
 By Malek Chtiwi, Date : 4/11/2007
The Melody of Words - Jack Kerouac: From Bebop to Punk
 By Aleksander Sienkiewicz, Date : 6/19/2007
The Difference Between Women & Men
 By Houda Mansour, Date : 6/1/2007
Epiphone Les Paul Black Beauty
 By Tor-Morten Olafsen, Date : 10/26/2008
Hair Loss drug
 By Anshul Mahajan, Date : 8/28/2008
Top 5
Unlock your Nokia phone online for FREE.
 By Xcess, Date : 4/1/2007
A Program That Can Fix Dead Pixels On Your LCD Screen.
 By Malek Chtioui, Date : 6/14/2007
How to Find and Download MP3 Music from Internet?
 By Malek Chtioui, Date : 6/19/2007
Pictures of Dubai, a New City In Full Expansion
 By Malek Chtioui, Date : 6/12/2007
Request.Url parameters & details (Asp.net)
 By Malek Chtioui (Xcess), Date : 4/7/2008