Configure Data Source Wizard


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
 
Ad

Advertisements

C

Chad Scharf

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,
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top