protected void DetailsView1_ItemInserted (object sender, DetailsViewInsertedEventArgs e) { DetailsView1.ChangeMode(DetailsViewMode.ReadOnly); }
But this code doesn't work , reason being DefaultMode is applied after the call to change the mode , to get it working or to get the mode changed, u need to write code like this
protected void DetailsView1_ItemInserted
(object sender, DetailsViewInsertedEventArgs e)
{
e.KeepInInsertMode = true;
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
}
Now mode will be changed , similarly you can change the mode to edit.
Nice info
ReplyDeleteThanks! This is exactly what I've been looking for.
ReplyDeleteVerry NICE Blog,... i wait you at my BLOG ...
ReplyDeleteWorked perfect. Thanks a lot.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete