Re: Newbie combo question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Shawn (bossman100_at_hotmail.com)
Date: 01/18/05


Date: Tue, 18 Jan 2005 13:43:43 +0100

If you are using .NET Framework 1.1 then you can use:
myDropDownList.SelectedValue

In .NET Framework 1.0 you can use SelectedIndex and then do a search for
your value, like this:
myDropDownList.SelectedIndex =
myDropDownList.Items.IndexOf(myDropDownList.Items.FindByValue(myValue))
or
myDropDownList.SelectedIndex =
myDropDownList.Items.IndexOf(myDropDownList.Items.FindByText(myText))

Hope this helps,
Shawn

"Nick" <Nick@NTWorks.no.spam.fsnet.co.uk> wrote in message
news:uwNcZdV$EHA.1188@tk2msftngp13.phx.gbl...
> I mean this one:
> System.Web.UI.WebControls.DropDownList
>
> Nick
>
> "Shawn" <bossman100@hotmail.com> wrote in message
> news:ubG7qYV$EHA.1904@TK2MSFTNGP14.phx.gbl...
> > Arrest me if I'm wrong, but from what I know there is no ComboBox
> > available
> > in ASP.NET
> > Are you using a Custom Control?
> >
> > Shawn
> >
> >
> > "Nick" <Nick@NTWorks.no.spam.fsnet.co.uk> wrote in message
> > news:eNGWFRV$EHA.3840@tk2msftngp13.phx.gbl...
> >> Hi - I've loaded the values into a combo box at runtime, but can't see
> >> how
> > I
> >> set the combo to a certain value when the page loads. (The value will
> > change
> >> depending on other variables when the page loads.)
> >>
> >> Thanks
> >>
> >> Nick
> >>
> >>
> >
> >
>
>



Relevant Pages

  • Re: Authentication popup comes up for Anonymous allowed app
    ... I have a asp.net web application on windows 2000 advanced server having ... latest security updates installed and .net framework 1.1. ... with latest patch. ... the page having custom control does not ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: creating HTML in code
    ... > Are there classes built into the .NET framework that will help me ... This is for custom control ...
    (microsoft.public.dotnet.framework.aspnet)
  • Authentication popup comes up for Anonymous allowed app
    ... latest security updates installed and .net framework 1.1. ... with latest patch. ... Eventhough application is configured to allow anonymous, ... the page having custom control does not ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Creating custom controls in VB.NET for pocket PC
    ... Is there a tutorial on creating a custom control in VB? ... (for compact, not the full .NET framework) ... I'd like to create a custom datagrid that is fully usable from the designer. ...
    (microsoft.public.dotnet.framework.compactframework)