显示下拉列表而不是文本框,以便在gridview中进行编辑 [英] displaying dropdownlist instead of textbox for editing in gridview
问题描述
我有一个表EMP_TAB,其列为NAME,ADDRESS,CITY,PHONE.
我想要这样的东西:
我已将表格视图EMP_TAB
的数据源绑定到一个gridview
当我在gridview中单击EDIT而不是文本框时,我希望显示一个下拉列表以更改CITY.
有关CITY的下拉列表的内容应从EMP_TAB
获取
请,如果有人可以对此有所了解.
:)
谢谢
Priyank
I have a table EMP_TAB with columns as NAME, ADDRESS, CITY, PHONE.
I want something like this:
I have bound a gridview with the datasource of above table, EMP_TAB
When I click on EDIT in gridview than instead of a textbox, I want a dropdownlist to be displayed for changing the CITY.
The content for that dropdownlist for CITY should be obtained from EMP_TAB
Please, if anybody can shed some light on this.
:)
Thanks
Priyank
推荐答案
嗨
您应该使用
Hi
You should use
<EditTemplate>
<asp:DropDownList runat="server" id="drpCity"></asp:DropDownList>
</EditTemplate>
请参考以下链接:
ASP.NET 2.0的GridView示例:在GridView中编辑基础数据 [ ^ ]
如有任何疑问,请让我知道.
请提供"投票":thumbsup:如果有帮助,请提供"接受答案",如果这是正确的答案.:rose:
谢谢,
Imdadhusen
Refer following link:
GridView Examples for ASP.NET 2.0: Editing the Underlying Data in a GridView[^]
Please do let me know, if you have any doubt.
Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:
Thanks,
Imdadhusen
这篇关于显示下拉列表而不是文本框,以便在gridview中进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!