This is a migrated thread and some comments may be shown as answers.

Keep Radgrid in Edit mode - URGENT

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
maha
Top achievements
Rank 1
maha asked on 14 Aug 2008, 06:18 PM

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;

}

}

1 Answer, 1 is accepted

Sort by
0
maha
Top achievements
Rank 1
answered on 14 Aug 2008, 06:27 PM
Got it now.
if i put e.Canceled = true. Grid is in edit mode.
Tags
Grid
Asked by
maha
Top achievements
Rank 1
Answers by
maha
Top achievements
Rank 1
Share this question
or