Krishna
Krishna

Reputation: 1

Combobox and Gridview

If we select the dropdown list Item then I want to display the Item Particulars in the Gridview Please Help me

Upvotes: 0

Views: 403

Answers (2)

TheTechGuy
TheTechGuy

Reputation: 17384

Add a dropdownlist control, a button control, a grid view and an sqldatasource.

  1. Configure the datasource first in sqldatasource.
  2. I would recommend write a storeprodure to fetch data into the gridview (sqldatasource).
  3. Bound the parameter to "controls" and select the dropdownlist. Now your DDL is bound to the gridivew. In his table click on advance properties and change property convertemptystringto null = false. (there property is something similar).
  4. If you want a button to update the grid view, do this. Add the default event control to the button, put no code in it.
  5. If you want to change the grid view content based on select directly then choose autopost on selected changed in properties of the DDL.

If everything is fine, this should populate your grid view based on contents in DropDownlist

Upvotes: 0

Josh Mein
Josh Mein

Reputation: 28655

On the SelectedIndexChanged of the dropdown rebind your GridView off of the selected value

Upvotes: 4

Related Questions