An even nicer way (okay, that's subjective, it's at least a different way)
to do this would be to inherit from
System.Web.UI.WebControls.DropDownListand add a few properties for
HasDefault and DefaultText.  Then maybe
override DataBind() and add a default list option after Base.DataBind().

You might want to implement IValidator interface as well so that you can
participate in Validation and properly handle the default option (that you
added in DataBind() ).

Then you'd have a reusable control that always did what you wanted.

Jeff

On 4/4/06, Charles Carroll <[EMAIL PROTECTED]> wrote:
>
>  AppendDataBoundItems Property helps too.
>
> http://weblogs.asp.net/scottgu/archive/2006/01/29/436804.aspx
> is relevant as well.
>
> On 4/3/06, orangefluffybun <[EMAIL PROTECTED]> wrote:
> >
> >    Hi All,
> >
> >  Question #1:
> >
> >  To add a blank value at the top of a dropdownlist, I am loading data
> >  into it in my FormView1_DataBound.
>
>
>  SPONSORED LINKS
>   Object 
> oriented<http://groups.yahoo.com/gads?t=ms&k=Object+oriented&w1=Object+oriented&w2=Programming+languages&c=2&s=48&.sig=f6H4QQqcmcp9kaxQRYmjcw>
>   Programming
> languages<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Object+oriented&w2=Programming+languages&c=2&s=48&.sig=r1ya7ggnEBNyfAH5-mYlDw>
>  ------------------------------
> YAHOO! GROUPS LINKS
>
>
>    -  Visit your group "AspNet2 <http://groups.yahoo.com/group/AspNet2>"
>    on the web.
>
>    -  To unsubscribe from this group, send an email to:
>     [EMAIL PROTECTED]<[EMAIL PROTECTED]>
>
>    -  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>    Service <http://docs.yahoo.com/info/terms/>.
>
>
>  ------------------------------
>



--
Jeff Schoolcraft
http://thequeue.net/blog/

Quid quid latine dictum sit, altum videtur


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNet2/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to