开发者

Combobox and Gridview

开发者 https://www.devze.com 2022-12-12 22:26 出处:网络
If we select the dro开发者_开发技巧pdown list Item then I want to display the Item Particulars in the Gridview Please Help meOn the SelectedIndexChanged of the dropdown rebind your GridView off of the

If we select the dro开发者_开发技巧pdown list Item then I want to display the Item Particulars in the Gridview Please Help me


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消