| re: how to create a property with drop options???
I got it to work. I forgot about enumerators and they did the trick.
Oooppsss
Regards
Lucas
"Lucas Sain" <lsain@lidersoft.com> wrote in message
news:uUBSGmXbDHA.1272@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hi,
>
> I'm trying to create a property in a class that should be apepar as
> dropdown combo at design time with X options. Something like the
> WindowStateProperty where you can select 3 options. How can this be done
> I've tried several ways but can't get it to work. Whta am I doing wrong?.
> This is what I have in the class
>
> private ComboBox fieldType= new ComboBox();
> private DataTable dtFieldType;
> loadCombo();
> [
>[/color]
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content),[color=blue]
> Editor(typeof(System.ComponentModel.Design.Collect ionEditor),
> typeof(System.Drawing.Design.UITypeEditor)),
> Description("Type you want to display")
> ]
> public ComboBox FieldType
> {
> get
> {
> return dtFieldType;
> }
> set
> {
> dtFieldType= value;
> }
> }
>
> private LoadCombo()
> {
> this.dtFieldType= new DataTable();
> this.dtFieldType.Columns.Add("Type");
> //============================================
> DataRow drFieldType = dtFieldType.NewRow();
> drFieldType ["Type"] = "String";
> dtFieldType.Rows.Add(drFieldType);
> //============================================
> drFieldType = dtFieldType.NewRow();
> drFieldType ["Type"] = "Date";
> this.dtFieldType.Rows.Add(drFieldType);
> //============================================
> drFieldType = dtFieldType.NewRow();
> drFieldType ["Type"] = "Numeric";
> this.dtFieldType.Rows.Add(drFieldType);
> //===
> tipoCampo.DataSource = this.dtFieldType;
> tipoCampo.DisplayMember = "Type";
> tipoCampo.ValueMember = "Type";
> }
>
>
> The combo does show up in Design time but no options are present.
>
> Help is really appreciated
> Lucas
>
>
>[/color] |