当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Drop-down box in Gridview

问题描述:

I have one asp.net c# grid-view.

This gridview requires dropdown box and drop-down box's selected data will come from database.

Please help me for this.

网友答案:

In that case, firstly populate the required data/fields on to the dropdownlist and in the dropdownlist_SelectedIndexChanged, make sure you write the code for populating the data in the GridView with your required with where clause specified; the where clause need to make use of the data selected in the dropdown list.. :)

Happy Coding.. :)

网友答案:

Not heaps clear on your question - some code snippets or a thorough description would be more useful. But I will soldier on!

You can convert any field in an ASP.NET GridView into a Template Field by selecting 'Edit Columns' on the Smart Tag. The Template Field will allow you to specify a control(s) to put inside that grid cell instead of a standard text box. You can bind it to whatever data source you like (or even bind the data source to the parent row). I suggest you google 'Grid View Template Field' for more thorough information about how to get it done.

分享给朋友:
您可能感兴趣的文章:
随机阅读: