【发布时间】:2012-02-19 13:34:43
【问题描述】:
我想在值为 1 时将我的 gridview 列的值更改为活动状态。 我有像
这样的 gridview 列<asp:BoundField DataField="STATUS" HeaderText="STATUS" SortExpression="STATUS" HeaderStyle-HorizontalAlign="Left">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
</asp:BoundField>
和cs代码
protected void gvCategory_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[5].Text=="0")
{
e.Row.Cells[5].Text = "INACTIVE";
}
}
}
这是有效的,但如果我更改列顺序,它会失败。 我需要的是 findControl 函数。 谢谢。
【问题讨论】:
标签: asp.net gridview rowdatabound