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

Distinguish Edit/Insert Mode on ItemCreated/ItemDataBound

1 Answer 138 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 1
Juan asked on 05 Aug 2011, 07:12 PM
Hello, 

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

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 10 Aug 2011, 03:53 PM
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)
    {
        if(RadTreeList1.IsItemInserted)
        {
            //item is about to be inserted
        }
        else
        {
            //item is about to be edited
        }
    }
}

I hope this helps.

Greetings,
Tsvetina
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.

Tags
TreeList
Asked by
Juan
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or