<asp:GridView ID="gvconfig" runat=server Width=500px AutoGenerateColumns="False" DataKeyNames="PARAM_VALUE" HorizontalAlign="Center" OnRowDeleting="gvconfig_RowDeleting" OnRowEditing="gvconfig_RowEditing" OnRowCancelingEdit="gvconfig_RowCancelingEdit" OnRowUpdating="gvconfig_RowUpdating" CellPadding="3">
<Columns>
<asp:BoundField DataField="param_name" HeaderText="配置名称">
<ItemStyle Width="320px" />
</asp:BoundField>
<asp:CommandField ButtonType="Image" ShowEditButton="True" EditImageUrl="../images/edit_button.gif" CancelImageUrl="../images/cancel_button.gif" UpdateImageUrl="../images/update_button.gif" />
<asp:CommandField ButtonType="Image" DeleteImageUrl="../images/delete_button.gif" ShowDeleteButton="True" />
<asp:BoundField DataField="param_type" Visible="False" />
<asp:BoundField DataField="param_value" Visible="False" />
<asp:BoundField DataField="param_name" Visible="False" />
</Columns>
<RowStyle Height="22px" />
<HeaderStyle BackColor="#E2F1FF" Height="24px" />
<AlternatingRowStyle BackColor="WhiteSmoke" />
</asp:GridView>---------------------------------------------------------------------- protected void gvconfig_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
JHXT_PARAM.updParamsRecords(this.gvconfig.Rows[e.RowIndex].Cells[3].Text,
this.gvconfig.Rows[e.RowIndex].Cells[4].Text,
this.dlitem.SelectedItem.Value,
JHXT_PARAM.retNo(this.dlitem.SelectedItem.Value),
((TextBox)this.gvconfig.Rows[e.RowIndex].Cells[0].Controls[0]).Text.Trim()
);
}
catch (System.Exception ex)
{
SysLog.Logger("ConfigParam.aspx", ex.ToString());
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('出现数据异常,请联系管理员!');</script>");
return;
}
Utility.MsgBox(this.Page, "已经成功编辑配置信息!", false);
this.gvconfig.EditIndex = -1;
this.bindDATA();
}------------------------------------------------------------------------this.gvconfig.Rows[e.RowIndex].Cells[3].Text
this.gvconfig.Rows[e.RowIndex].Cells[4].Text这两列的数据取不到,取出来是空的,帮我看看,谢谢!
<Columns>
<asp:BoundField DataField="param_name" HeaderText="配置名称">
<ItemStyle Width="320px" />
</asp:BoundField>
<asp:CommandField ButtonType="Image" ShowEditButton="True" EditImageUrl="../images/edit_button.gif" CancelImageUrl="../images/cancel_button.gif" UpdateImageUrl="../images/update_button.gif" />
<asp:CommandField ButtonType="Image" DeleteImageUrl="../images/delete_button.gif" ShowDeleteButton="True" />
<asp:BoundField DataField="param_type" Visible="False" />
<asp:BoundField DataField="param_value" Visible="False" />
<asp:BoundField DataField="param_name" Visible="False" />
</Columns>
<RowStyle Height="22px" />
<HeaderStyle BackColor="#E2F1FF" Height="24px" />
<AlternatingRowStyle BackColor="WhiteSmoke" />
</asp:GridView>---------------------------------------------------------------------- protected void gvconfig_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
JHXT_PARAM.updParamsRecords(this.gvconfig.Rows[e.RowIndex].Cells[3].Text,
this.gvconfig.Rows[e.RowIndex].Cells[4].Text,
this.dlitem.SelectedItem.Value,
JHXT_PARAM.retNo(this.dlitem.SelectedItem.Value),
((TextBox)this.gvconfig.Rows[e.RowIndex].Cells[0].Controls[0]).Text.Trim()
);
}
catch (System.Exception ex)
{
SysLog.Logger("ConfigParam.aspx", ex.ToString());
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('出现数据异常,请联系管理员!');</script>");
return;
}
Utility.MsgBox(this.Page, "已经成功编辑配置信息!", false);
this.gvconfig.EditIndex = -1;
this.bindDATA();
}------------------------------------------------------------------------this.gvconfig.Rows[e.RowIndex].Cells[3].Text
this.gvconfig.Rows[e.RowIndex].Cells[4].Text这两列的数据取不到,取出来是空的,帮我看看,谢谢!
解决方案 »
- SqlDataAdapter.Update,不能进行数据更新
- asp.net读取XML文件后怎么执行分页啊
- TextBox 绑定时char类型时,后面有空格,如何去掉
- 熟悉GridView控件的高手来。。急!!!!vs2005中的
- 请教:DataGrid中取值条件问题,急!
- asp.net[vb]问题求解,有关onselectedindexchanged事件发生条件的。
- 请问如何建立xsd
- 关于页面刷新后重定位的问题!
- 如何用在客户端触发服务端事件,并返回结果?
- 轻看下面一段login的代码
- GridView加入 CheckBox为什么得不到CheckBox.Checked==true?
- 救命,我在web里把server="计算机名"改成server="ip地址"就连不上了
用模版列,把数据放到一个Label控件上,然后this.gvconfig.Rows[e.RowIndex].FindContrlByID("label")查找这个Label,然后取Label的Text值即可