provide several values for a String property

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default provide several values for a String property

    Hi all,

    If you look at the properties window of a HyperLink control (during the
    design time), you'll notice that its property Target is a System.String,
    which has several pre-defined values, such as "_self", "_blank", etc.
    Moreover, the designer allows you to enter your own custom property value.

    How can I implement the same behavior in my custom control? Is there an
    Attribute one can use to supply several pre-defined values?

    -Oleg.


    Oleg Ogurok Guest

  2. Similar Questions and Discussions

    1. Resetting Property Values
      You could probably walk the class and check for properties with a DefaultValue attribute; pull the value of the attribute and see the property. This...
    2. Problem with Property values in HTML tag
      When I set one of my custom control properties programmtically the control, as below, the control gets the value and spits it back out at the right...
    3. Property with multiple values
      Hello folks! I'm creating a control that needs to accept an unlimited list of ids for TextBoxe or DropDownList controls, preferably with check for...
    4. Custom Property doesn't save values
      Hello all, I've defined a custom control with the property of type string. If I assigned values to the property at design time, I can see these...
    5. Sorting property list by the values
      Hello all I'm not sure if I can do this without an Xtra or summat... I have a property list like this: I want to sort this list by the...
  3. #2

    Default Re: provide several values for a String property

    "Oleg Ogurok" <oogurok@thecramgroup.ihatespammers.ireallydo.co m> wrote in
    message news:2fcd8$3f5e20e8$825ec943$14085@nf1.news-service.com...
    > Hi all,
    >
    > If you look at the properties window of a HyperLink control (during the
    > design time), you'll notice that its property Target is a System.String,
    > which has several pre-defined values, such as "_self", "_blank", etc.
    > Moreover, the designer allows you to enter your own custom property value.
    >
    > How can I implement the same behavior in my custom control? Is there an
    > Attribute one can use to supply several pre-defined values?
    Yes. You can assign a TypeConverter to your property, and use the
    GetStandardValues and GetStandardValuesExclusive methods.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    John Saunders Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139