M
MohanedAmine
Guest
i'm using c# class library to create a custom control. i have no problem with simple collection of type, this is an example how i use it:
namespace PersoComboBox
{
public class ComboColDisplay
{
private string name;
private int percentage;
public string ColName
{
get { return this.name; }
set { this.name = value; }
}
public int ColPercent
{
get { return this.percentage; }
set { this.percentage = value; }
}
public ComboColDisplay()
{
}
}
public class PersoComboBox : ComboBox
{
//Variables locales
ErrorProvider EP = new ErrorProvider();
//Collection property
private List<ComboColDisplay> listColDisplay = new List<ComboColDisplay>();
[Category("xControl properties")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public List<ComboColDisplay> PListColumnDisplay
{
get { return listColDisplay; }
set { listColDisplay = value; Invalidate(); }
}
public PersoComboBox()
{
}
private void refreshDrawMode()
{
if (listColDisplay.Count > 0) { this.DrawMode = DrawMode.OwnerDrawVariable; }
else { this.DrawMode = DrawMode.Normal; }
}
}
}
Now i want to use collection of collection of type as a property ! how can i do it ?
Thanks.
Continue reading...
namespace PersoComboBox
{
public class ComboColDisplay
{
private string name;
private int percentage;
public string ColName
{
get { return this.name; }
set { this.name = value; }
}
public int ColPercent
{
get { return this.percentage; }
set { this.percentage = value; }
}
public ComboColDisplay()
{
}
}
public class PersoComboBox : ComboBox
{
//Variables locales
ErrorProvider EP = new ErrorProvider();
//Collection property
private List<ComboColDisplay> listColDisplay = new List<ComboColDisplay>();
[Category("xControl properties")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public List<ComboColDisplay> PListColumnDisplay
{
get { return listColDisplay; }
set { listColDisplay = value; Invalidate(); }
}
public PersoComboBox()
{
}
private void refreshDrawMode()
{
if (listColDisplay.Count > 0) { this.DrawMode = DrawMode.OwnerDrawVariable; }
else { this.DrawMode = DrawMode.Normal; }
}
}
}
Now i want to use collection of collection of type as a property ! how can i do it ?
Thanks.
Continue reading...