Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7414779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:10:08+00:00 2026-05-29T07:10:08+00:00

I use dropdownlist to refine my GridView. Dropdownlist is bind to AccessDataSource (table categories)

  • 0

I use dropdownlist to refine my GridView. Dropdownlist is bind to AccessDataSource (table categories) and has a dummy field (Please select).

<asp:Label ID="Label1" runat="server" Text="Refine your search"></asp:Label><br />
      <asp:DropDownList ID="ddlCategories" runat="server" AppendDataBoundItems="True" 
          AutoPostBack="True" DataSourceID="ADC_Categories" DataTextField="CatedName" 
          DataValueField="Categ_Id">
          <asp:ListItem Value="">-- please choose --</asp:ListItem>
      </asp:DropDownList>

The GridView (product table) is bind to dropdownlist and returns results respectively to the selected dropdownlist value. However, if dummy field is selected – No data is returned (there are no matching CategoryID from dropdownlist – its value is null)

How can I simply return all records in GridView when dummy field is selected??

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:10:10+00:00Added an answer on May 29, 2026 at 7:10 am

    Change the SELECT statement to SELECT [Product_Id], [ProductName], [Price], [ReleaseDate], [Promotion], [Genre_Id], [Category_Id] FROM [tblProduct] WHERE ([Category_Id] = @Category_Id OR @Category_Id IS NULL) and set the CancelSelectOnNullParameter property of the AccessDataSource to False.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd to use my database field value to select a value on my <s:DropDownList
I have an ASP.NET webform on which I use a DropDownList control to allow
I am quite confused with how to effectively use the Html.DropDownList helper for ASP.NET
Summary: If you use ASP.NET MVC 2's templates to render a DropDownList, how would
how to use required field validator for dropdownlist?. my dropdown list having -Day- item1
If I use: OnSelectedIndexChanged like this: <asp:DropDownList ID=ddl1 AutoPostBack=true OnSelectedIndexChanged=Test_SelectedIndexChanged runat=server></asp:DropDownList> UpdatePanel and UpdateProgress
I am trying to create a subclass of asp:DropDownList so I can use asp:DdlNoEventValidation
i use jquery serialize() with asp.net server controls. <asp:DropDownList ID=ddFirmaAd runat=server Width=180 Height=25> </asp:DropDownList>
i use this code to fill dropdownlist ViewData[projectType] = new SelectList (_dataManager.Project.ProjectTypeList(), Id, Name);
I want to use a ComboBox with the DropDownList style (the one that makes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.