gridview 模板中的数据绑定下拉列表
我需要根据网格视图该行中另一列中的文本来限制放置在网格视图中模板列中的数据绑定下拉列表中的值。我还希望下拉菜单是数据绑定的。显然,这两件事不可能同时发生,因为它会产生数据绑定错误。我认为 .net 会阻止它,因为数据库中可能出现下拉列表中不存在的有效值。
我如何使用下拉菜单或任何其他方法来完成此操作。
请帮忙。
I need to limit the values in a data bound drop down placed in a template column in a gridview based on the text in another column in that row of the gridview. I also want the dropdown to be databound. Aparently, these two things are not possible at the same time as it gives a data bind error. I think .net prevents it because there is a likelihood of a valid value appearing in the database which doesnt exist in the drop down.
How can I accomplish this using a drop down or any other method.
Kindly help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过根据文本框中输入的值过滤要显示的数据来限制数据绑定下拉列表的值吗?
在事件 grd_RowDataBound 上放置 ff: 测试代码
You can limit the value of databound dropdown by filtering the data to be displayed based on the values entered on the textbox right?
On the event grd_RowDataBound put the ff: test code