Supermode
Supermode

Reputation: 936

RadGrid on changing grid mode after update

For some reason the code that I have below does not change the mode from edit mode to display mode once update is complete. Please advise.

protected void gridData_UpdateCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem editItem = (GridEditableItem)e.Item;
    GridEditManager editMan = editItem.EditManager;

    Label lblDataId = editItem.FindControl("lblDataId") as Label;
    TextBox txtDataName = editItem.FindControl("txtDataName ") as TextBox;

    string dataName = txtDataName.Text;

    int dataId = Convert.ToInt32(lblDataId .Text);
    stateBLL.UpdateState(dataId, dataName);

    gridData.DataBind();
}

Upvotes: 0

Views: 541

Answers (1)

Leo
Leo

Reputation: 14820

The row will stay on "edit mode" unless you explicitly revert it back to "view mode". Try setting it to "view mode" when you finish updating, just before the gridData.DataBind(); line add the following line of code...

e.Item.Edit = false;

Upvotes: 1

Related Questions