public bool _visible = false; public bool IsVisible { get { return _visible; } set { _visible = value; } }
<ItemTemplate> <asp:Label ID="Label4" runat="server" Visible='<%# !(bool) IsVisible %>' Text='<%# Bind("max") %>'> </asp:Label> <asp:TextBox ID="TxtMax" Visible='<%#IsVisible %>' Text='<%#Bind("max") %>' runat="server"></asp:TextBox> </ItemTemplate>
protected void Edit_Button_Click(object sender, EventArgs e) { _Visible = true; GridView1.DataBind(); }<H2>To Update All Rows. </H2>
protected void Update_Button_Click(object sender, EventArgs e){for (int i=0;i< GridView1.Rows.Count;i++) Gridview1.UpdateRow(i, true); _Visible = false; Gridview1.DataBind();}