DropDownList properties .. no SelectedValue ...

  • Thread starter Thread starter Barrie Wilson
  • Start date Start date
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
 
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.
 
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?
 
Yes, it can be bound just fine. It just isn't Visible i basically in
property browser (and therefore not in ASPX Intellisense).
 
Back
Top