如何在GridView中获取隐藏文本到数据集 [英] how to get hidden text in the gridview to dataset
问题描述
嗨..........
我试图将gridview中的数据复制到数据集.在我的网格中,我有文本框,下拉列表和bound字段.一个boundfield保持可见false.我想将gridview中的数据复制到dataset.i在除单元格值中的所有单元格中都有值可见的错误列.我想使该字段不可见,但希望使用它的数据.提供解决方案.
hi..........
I am trying to copy data in the gridview to dataset.In my grid i have textbox,dropdown and bound field.One boundfield kept visible false.i want copy data in the gridview to dataset.i got value in all cell except cell value in visible false column.I want to this field invisible but want use its data.provide soln thanx
推荐答案
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.gridviewrow.dataitem.aspx [
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewrow.dataitem.aspx[^]
You can also use
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("ColumnName")%>'/>
进一步了解:
http://stackoverflow.com/Questions/4974530/how-to-to-use-a-hidden-bound-field-in-a-gridview-in-asp-net [
Check more on :
http://stackoverflow.com/questions/4974530/how-to-use-a-hidden-boundfield-in-a-gridview-in-asp-net[^]
添加样式显示:无边框和标头样式
代码:
adding style display:none to bounded field as well as header style
code:
<asp:boundfield datafield="pk_id" readonly="True" headertext="pk_id" itemstyle-cssclass="hidden" xmlns:asp="#unknown">
<headerstyle font-bold="True" forecolor="White" width="26%">
CssClass="hidden" BorderColor="White" BorderStyle="Solid"/>
</headerstyle></asp:boundfield>
Style:
<style type="text/css" >
.hidden{
display:None;
}
</style>
这篇关于如何在GridView中获取隐藏文本到数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!