Configure Data Source Wizard

Discussion in 'ASP .Net' started by rodchar, Jan 12, 2008.

  1. rodchar

    rodchar Guest

    hey all,
    i'm manually adding my items to my dropdownlist that will filter the
    gridview under it.

    i go thru the Configure Data Source Wizard on the gridview in which i
    specify the dropdownlist control value to be the filter in my WHERE clause.

    it works fine except i don't know how to get the NULL records to show up. is
    it possible to specify a NULL item when manually adding items to my
    dropdownlist?

    thanks,
    rodchar
     
    rodchar, Jan 12, 2008
    #1
    1. Advertising

  2. rodchar

    Chad Scharf Guest

    When you are manually adding items to your DropDownList, simply use:

    MyDropDownListControl.Items.Add(string.Empty);

    Or in your Markup, <asp:ListItem Value="" Text="" />

    Then in your configure data source wizard, for that control you can specify
    the DefaultValue="" or leave it blank, then set the
    ConvertEmptyStringToNull="True".

    This will place a blank item in your select list in the rendered HTML, as
    well as set the value for the parameter to NULL when the blank option is
    selected for your data source control.

    Hope this helps.

    Thanks,

    --
    Chad Scharf
    _______________________________
    http://www.chadscharf.com


    "rodchar" wrote:

    > hey all,
    > i'm manually adding my items to my dropdownlist that will filter the
    > gridview under it.
    >
    > i go thru the Configure Data Source Wizard on the gridview in which i
    > specify the dropdownlist control value to be the filter in my WHERE clause.
    >
    > it works fine except i don't know how to get the NULL records to show up. is
    > it possible to specify a NULL item when manually adding items to my
    > dropdownlist?
    >
    > thanks,
    > rodchar
     
    Chad Scharf, Jan 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. monika
    Replies:
    0
    Views:
    433
    monika
    Jun 24, 2005
  2. HS1
    Replies:
    0
    Views:
    470
  3. Replies:
    0
    Views:
    625
  4. David
    Replies:
    0
    Views:
    335
    David
    Jan 21, 2007
  5. Don

    Custom Designer - Configure Data Source wizard

    Don, Oct 20, 2010, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    1,007
Loading...

Share This Page