Show all items in gridview based on dropdown lists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Suny
    New Member
    • Jul 2013
    • 3

    #1

    Show all items in gridview based on dropdown lists

    Hello everybody ... I have a gridview that display data from SQL table using the Configure data source with where clause to show data based on 2 Dropdown list


    It works fine and the data already show based on the choices of the drop menu .... but I need to SHOW ALL Items on gridview when I select the SHOW ALL from the dropdown menu

    Can anybody help me please???
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Is your DropDownList configured to autopostback?
    Do you have code that handles it's selected index changed event?

    If so, have you tried setting the DataSource of the GridView to a source that has all of the records?

    If so, did you call the DataBind method on the GridView after you set it's DataSource?

    -Frinny

    Comment

    • Suny
      New Member
      • Jul 2013
      • 3

      #3
      Thanks for your kindly reply and your attention

      Yes my dropdownlist configured to autopostback

      No I didn't generate any code (it's required to do it without any coding)

      Yes I did , It's connected to the data source (table) that has all the data

      Look I did it as follow:
      1- My grideview -- add data source -- add new datasource.
      2- choose the connectionstrin g
      3- On the configure the Select data source I choose the all fields then click the Where button.
      4- Choose the Data control = Dropdownlist 1 then choose the field and the same for dropdownlist 2

      Now it works fine and it filter the data except It didn't return the ALL value

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Then it is something in your select statement?

        -Frinny

        Comment

        • Suny
          New Member
          • Jul 2013
          • 3

          #5
          Could you please tell me the select statement how should it be??

          Comment

          Working...