Distinguish Edit/Insert Mode on ItemCreated/ItemDataBound

2 posts, 0 answers
  1. Juan
    Juan avatar
    6 posts
    Member since:
    Jan 2011

    Posted 05 Aug 2011 Link to this post


    I would like to tweak some of the UI components on the cells when items are being edited / inserted.

    I'm able to identify when an item is being edited through TreeListDataItem.IsInEditMode property, but I cannot find the way to know if the item is being inserted.

    So the question will be: how to know within the ItemCreated event if an item is in insert mode?

    Thanks in advance
  2. Tsvetina
    Tsvetina avatar
    2102 posts

    Posted 10 Aug 2011 Link to this post

    Hello Juan,

    This can be done by checking the IsItemInserted property of the treelist:
    protected void RadTreeList1_ItemCreated(object sender, TreeListItemEventArgs e)
        if(e.Item is TreeListEditableItem && e.Item.IsInEditMode)
                //item is about to be inserted
                //item is about to be edited

    I hope this helps.

    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top