Configure Data Source Wizard

  • Thread starter Thread starter rodchar
  • Start date Start date
R

rodchar

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
 
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,
 
Back
Top