I have a grid with EditForm set as FormTemplate.
I am handling Update through ItemCommand.
During update if there is an error i want to keep the item in edit mode.
But i am not able to.
this is my code
if (e.CommandName == "Update")
{
GridEditableItem editItem = (GridEditableItem)e.Item;
int recID = Int32.Parse(editItem.GetDataKeyValue("MTSWebSecurityLoginID").ToString());
userName = ((
TextBox)e.Item.FindControl("txtUserName")).Text;
initialPwd = ((
TextBox)e.Item.FindControl("txtInitialPwd")).Text;
usrPwd = ((
TextBox)e.Item.FindControl("txtUserpassword")).Text;
email = ((
TextBox)e.Item.FindControl("txtEmail")).Text;
masterAccountNumber = ((
TextBox)editItem.FindControl("txtMasterAcctNumber")).Text;
AddUpdateAffiliateLogin(recID);
if (errorMessage == "")
{
e.Item.Edit =
false;
}
else
{
Label lblStatus = (Label)e.Item.FindControl("lblStatus");
lblStatus.Visible =
true;
lblStatus.Text = errorMessage;
e.Item.Edit =
true;
}
}