Ejemplo n.º 1
0
        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            originalDataTable = (System.Data.DataTable)ViewState["originalValuesDataTable"];
            int cnt = 0;

            foreach (GridViewRow r in GridView1.Rows)
            {
                if (isRowModified(r))
                {
                    GridView1.UpdateRow(r.RowIndex, false);
                    cnt++;
                }
            }
            // rebind the Grid to repopulate the original values table
            if (cnt > 0)
            {
                StatusLabel.Text = "Update Complete";
            }
            else
            {
                StatusLabel.Text = "";
            }
            tableCopied = false;
            GridView1.DataBind();
        }
Ejemplo n.º 2
0
        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            originalDataTable = (DataTable)ViewState[ORIGINAL_VALUES_DATA_TABLE];

            foreach (GridViewRow gridRow in GridView1.Rows)
            {
                if (IsRowModified(gridRow))
                {
                    GridView1.UpdateRow(gridRow.RowIndex, false);
                }
                tableCopied = false;
                GridView1.DataBind();
            }
        }
Ejemplo n.º 3
0
    //</Snippet1>

    //<Snippet2>
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        originalDataTable = (System.Data.DataTable)ViewState["originalValuesDataTable"];

        foreach (GridViewRow r in GridView1.Rows)
        {
            if (IsRowModified(r))
            {
                GridView1.UpdateRow(r.RowIndex, false);
            }
        }

        // Rebind the Grid to repopulate the original values table.
        tableCopied = false;
        GridView1.DataBind();
    }