简体   繁体   English

Gridview中的下拉框

[英]Drop-down box in Gridview

I have one asp.net c# grid-view. 我有一个asp.net C#网格视图。 This gridview requires dropdown box and drop-down box's selected data will come from database. 此gridview需要下拉框,并且下拉框的选定数据将来自数据库。 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; 在这种情况下,首先将必需的数据/字段填充到dropdownlist上,并在dropdownlist_SelectedIndexChanged中,确保使用所需的where子句编写了用于在GridView中填充数据的代码; the where clause need to make use of the data selected in the dropdown list.. :) where子句需要利用下拉列表中选择的数据。.:)

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. 您可以通过选择智能标记上的“编辑列”,将ASP.NET GridView中的任何字段转换为模板字段。 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. 我建议您在google的“网格视图模板字段”中获取有关如何完成此操作的更全面的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM