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

Tell if in Insert or Edit

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 13 Dec 2010, 10:24 PM
I have a grid that uses a form template for edit and insert.  I would like to change the heading in the grid to reflect that the user is doing.  How to I determine which mode I am in.  I have found .IsInEditMode but this is true if in insert or edit.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Dec 2010, 05:49 AM
Hello Eric ,

You can distinguish the Edit and insert mode using the following condition.

C#:
if (e.Item is GridEditFormItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted)//Checks for edit mode
       {   
       }
if
(e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)//Checks for insert mode
       {
       }

Please go through the following documentation for more on this.
Distinguish edit/insert mode on ItemCreated/ItemDataBound

Thanks,
Princy.
Tags
Grid
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or