我有一个网格,我需要从后面的代码中获取gridview c#中的只读文本框值

最佳答案

protected void grd1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
           if (txt.Text != "")
            {
                txt.Attributes.Add("readonly", "readonly");
                txt.Visible = false;
                lbltaskname.Visible = true;
            }
            else
            {
                txt.Attributes.Remove("readonly");
            }
        }
    }

关于c# - 如何从后面的代码中获取GridView C#中的只读文本框值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37627263/

10-09 15:59
查看更多