Working with a 2 column Dropdown

Discussion in 'ASP .Net Building Controls' started by jonefer, Jul 28, 2006.

  1. jonefer

    jonefer Guest

    I know how to fill a dropdown list and use it's selected value as a parameter.
    How can I setup 2 columns, hide one column but use the hidden column (a key)
    as the parameter

    For example:

    Prov, ProvID (hidden column)

    =====
    ..SelectedValue.column()....?
     
    jonefer, Jul 28, 2006
    #1
    1. Advertisements

  2. jonefer

    msnews Guest

    You can set the DataValueField and DataTextField properties to match the
    properties you want set from the datasource. In this case, the hidden
    parameter is the DataValueField. To get it back from the DropDownList after
    a PostBack you get SelectedValue. It does work like a GridView where you do
    have to hide the key fields to use them as parameters.

    Brennan Stehling
    http://brennan.offwhite.net/blog/
     
    msnews, Sep 11, 2006
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...