Click here to Skip to main content
15,921,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have get value from cell in gridview when that cell is updated
i write this code but not working true

C#
public partial class admin_Def_hoze : System.Web.UI.Page
{
    GridViewRow row;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        row = GridView1.Rows[e.RowIndex];    
    }
    protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
    {
        GridViewRow row = GridView1.Rows;
        string str = row.Cells[2].Text;
    }
}
Posted
Updated 17-Sep-12 3:30am
v2

1 solution

Call the function 'AcceptChanges()' on the datasource for this grid before fetching any cell value.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900