Re: DropDownList and ListItem

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 12/08/04


Date: Wed, 8 Dec 2004 09:10:01 -0500

Fabio,

    The DropDownList doesn't exist in Windows Forms. I assume you mean the
ComboBox control. In this case, you would use the Items property, which is
the indexer (I believe) for the class.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Fabio Negri Cicotti [MCP]" <cicotti@hotmail.com> wrote in message 
news:e$so8vS3EHA.1300@TK2MSFTNGP14.phx.gbl...
> Sorry for my silly question...
>
> in the same way we can define in a DropDownList the "ValueMember" and 
> "Display Member" when we bind a DatasSource, how could I do it using a 
> hard-code fixed datasource (without neither access the DB or create a 
> DataTable)?
>
> To be as clear as possible, if I want to fill a DropDownList with the 
> following data (not comming from database, but from my source-code), how 
> do I do?
>
> ID - Desciption
> 3 - Desc 3
> 6 - Desc 6.1
> 7 - Desc 7
>
> With ASP.NET I use ListItem but it seems don't work with windows forms.
>
>
> Kind regards,
>
> Fabio Negri Cicotti
> Software Engineer
> 


Relevant Pages

  • Re: Changing the VS 2003 Templates
    ... Nicholas Paldino [.NET/C# MVP] ... wasn't in the folder but it at least showed me where to look. ... > Nicholas Paldino wrote:>> Greg, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Unexpected error writing metadata. WTF?
    ... I referenced previously was the first link. ... Nicholas Paldino [.NET/C# MVP] ... > Nicholas Paldino schrieb:>> Rüdiger, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [OT] Graphics Card
    ... Nicholas Paldino [.NET/C# MVP] ... To be more precise,> the flicker occurs exactly where the labels and buttons are being drawn> on the modal form. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is it possible to call C# code from C++ ?
    ... Qualifying .NET Types for Interoperation ... Nicholas Paldino [.NET/C# MVP] ... > Nicholas Paldino wrote:>> Ricky, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# Generics: Why int[] doesnt implement IList<int>?
    ... Nicholas Paldino [.NET/C# MVP] ... > Nicholas Paldino wrote:> ... > used to implement arrays. ...
    (microsoft.public.dotnet.languages.csharp)

Loading