从隐藏列获取值时出现问题. [英] Problem in getting values from hidden column.
本文介绍了从隐藏列获取值时出现问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有没有办法像在下拉菜单中那样将值绑定到网格中的任何垂直列?
Hello guys,
Is there any way to bind values to any perticular column in grid like we can do in dropdown?
<br />
dropdown1.DataValueField = data source column
我有一个网格,但是我必须隐藏该网格的"ID列",所以当我在保存"按钮上单击保存记录时,我没有得到ID,因为我想根据以下内容保存新订单数据库中的ID.
有什么办法可以让ID保持ID列可见="false"?
如果我将其显示为ii,将再次开始获取ID.
感谢
I have a gridm, but I have to hide the ID Column of that grid so when I am saving the records on save button click, I am not getting the ID''s, as I want to save the new order on the basis of ID''s in the database.
Is there any way I can get the ID''s keeping the ID column visible="false"?
If I make it visible ii starts getting the ID''s again.
Thanks
推荐答案
这是代码段,您可以根据需要进行增强和使用.只需在后台代码中处理行编辑事件即可.
This is the code snippet, you can enhance and use as you require. Just handle the row-editing event in code-behind.
asp:GridView ID="gvwTest" runat="server" CssClass="display" AutoGenerateColumns="False" DataKeyNames="id" OnRowEditing="gvwTest_RowEditing" Width="100%">
<columns>
<asp:boundfield datafield="code" headertext="Code" itemstyle-width="75px" xmlns:asp="#unknown" />
<asp:boundfield datafield="name" headertext="Name" xmlns:asp="#unknown" />
<asp:commandfield showeditbutton="True" itemstyle-width="50px" xmlns:asp="#unknown" />
</columns>
这篇关于从隐藏列获取值时出现问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文