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
The short history and the origin of the word LIMOUSINE
 By Josée Hanlon, Date : 7/31/2007
Pharo Tours (Egypt and worldwide tour packages)
 By Pharo Tours, Date : 1/20/2008
Special ISO Characters
 By Xcess, Date : 4/21/2007
Wandering thought ---- Do the ghosts really exist --- A mass awareness drive
 By MIraclestudios, Date : 6/16/2008
Nefertiti: Whose culture is it, anyway?
 By Ben Morales-Correa, Date : 7/18/2007
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