GridView中加入DropDownList
原创
©著作权归作者所有:来自51CTO博客作者gongjing212的原创作品,请联系作者获取转载授权,否则将追究法律责任
比如:我有一个表有:姓名、性别、年龄等字段。现在,要实现GridView的编辑。我在这想用DropDownList去选择性别。那么在Grid View中把性别这个字段转换为TemplateFied(在GridView任务编辑中),然后开始编辑模板如图中在EditItemTemplate中加入DropDownList,但是会发现在运行点编辑的时候DropDownList并不会如愿的呆在想编辑的地方,无论你点哪一行,它总是不变的呆在一个地方,也点是你在编辑页面时拖的地方,要怎么把它放在编辑的地方呢?我们打开html,会找到加入DropDownList下面的代码:
<EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" Style="z-index: 100; left: 59px; position: absolute; top: 229px" Width="120px"> </asp:DropDownList> </EditItemTemplate>
这时最后一步了,我们去掉后面的style,把它改成:
<EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" > </asp:DropDownList> </EditItemTemplate>
OK,大功告成了,恭喜恭喜~~~
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
解决ASP.NET GridView中加入RadioButton不能单选
今天开发碰见一个问题,就是当GridView中加入一个包含RadioButton的模板列,结果一运行。。。。。天啊,单选按钮可以多选了! 囧啊!为了演示一下我今天的错误我还是模拟一个功能场景吧,我要实现的功能是显示一个包含单选按钮的学生信息列表,选择一行后将详细信息显示出来~! &nbs
职场 休闲 GridView RadioButton GridViewRadioButton -
MyEclipse中加入subEclipse
1.6的 http://subclipse.tigris.org/update_1.6.x Name: Subclipse 1.2.x (Eclipse
myeclipse eclipse url bc Software -
tabactivty中加入地图
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.c
Android Google XML OS Access -
DropDownList在GridView中(vb.net)
曾有用户给Insus.NET留言,下拉式菜单DropDownList在GridView编辑选择。 http://www..com/insus/articles/1411016.html#2053183,需要vb.net版本,现在Insus.NET把主要部分的改写了一些,请参考:xxx.aspx HTML程序:View Code <asp:GridViewID="GridView1"runat="server"SkinID="gridviewSkin"DataKeyNames="MediaId"A
Edit GridView asp.net DropDownList Update