Tell if in Insert or Edit

2 posts, 0 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 13 Dec 2010 Link to this post

    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.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Dec 2010 Link to this post

    Hello Eric ,

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

    if (e.Item is GridEditFormItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted)//Checks for edit mode
    (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

Back to Top