Re: DropDownList properties .. no SelectedValue ...




"Teemu Keiski" <joteke@xxxxxxxxxxxxxxx> wrote in message
news:Ow4cz7wGIHA.1316@xxxxxxxxxxxxxxxxxxxxxxx
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?



Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



"Barrie Wilson" <bwilson@xxxxxxxxxxx> wrote in message
news:13iekn04pt480d6@xxxxxxxxxxxxxxxxxxxxx

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





.



Relevant Pages

  • RE: Drop Down List Box Asp.net (VB)
    ... try only bind the dropdownlist in the first load. ... 'Bind dropdownlist. ... I don't see any property name with selectedValue. ... post ASP.NET related problems in DotNet.Framework.aspnet. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Insane Databinding (probably a bug)
    ... SelectedValue is a property, not an attribute which is an error I would ... in my code i bind a few dropdownlist boxes's lists, ... bind the Selectedvalue property, and everything is fine. ... bright day, WITHOUT ANY CHANGE TO THE DATABINDING CODE, i started ...
    (microsoft.public.dotnet.framework.aspnet)
  • Insane Databinding (probably a bug)
    ... in my code i bind a few dropdownlist boxes's lists, ... bind the Selectedvalue property, and everything is fine. ... i have the same issue with a dropdown that has a predefined ...
    (microsoft.public.dotnet.framework.aspnet)
  • comboBox SelectedValue behaviour
    ... I have an object populated from the database, The object has three properties, ... Regardless when I bind the objectcollection to the DataSourse property I get ... When I get the SelectedValue of the comboBox it returns the selectedIndex ... Has anyone else seen this behaviour and know of a workaround ...
    (microsoft.public.dotnet.languages.csharp)

Loading