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
FED & SED Monitors; New technology 2009
 By Chtioui Malek, Date : 5/2/2007
India Travel Ressources
 By Xcess Tr, Date : 8/27/2008
Tozeur, Tunisia
 By Xcess, Date : 1/23/2007
Visiting Tunisia? Don't miss Sidi Bou Said!
 By Xcess, Date : 1/23/2007
about PayPal eChecks
 By about PayPal eChecks, Date : 2/7/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