Combobox and Gridview

409 Views Asked by At

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

2

There are 2 best solutions below

0
On

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

0
On

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