DropDownList properties .. no SelectedValue ...

B

Barrie Wilson

I have a DropDownList on a plain vanilla ASPX page,

<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource2" .... etc >

The issue is that Intellisense is not displaying "SelectedValue" as an
option ... I'm using VS 2005, Framework 2.0.50727 and coding in C# ...

Anyone have any idea what might be going on here?

TIA

BW
 
T

Teemu Keiski

It is meant to be used in code only. SelectedValue property is assigned with
Browsable(false) attribute which prevents it from being viewed / edited in
design-time.
 
B

Barrie Wilson

Teemu Keiski said:
It is meant to be used in code only. SelectedValue property is assigned
with Browsable(false) attribute which prevents it from being viewed /
edited in design-time.

Thanks, Teemu ... so is there a better way to bind a DropDownList value
which is part of a FormView InsertItemTemplate to a data source? Right now
I'm ignoring Intellisense and using this:

<InsertItemTemplate >
<asp:DropDownList ID="drawingTypes"
runat="server"
DataSourceID="SQL_DatSource_drawingTypes"
SelectedValue='<%# Bind("dType") %>'
DataTextField="dType"
DataValueField="dType"
</asp:DropDownList>
.....
</InsertItemTemplate >

this works fine ... what is the prefered way of doing this if not by using
SelectedValue in the template?
 
T

Teemu Keiski

Yes, it can be bound just fine. It just isn't Visible i basically in
property browser (and therefore not in ASPX Intellisense).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top