Issue due to fix on Q2 release: Fixed: Setting InsertItemPosition should not show the insert item

4 posts, 0 answers
  1. Ben Grossman
    Ben Grossman avatar
    12 posts
    Member since:
    Nov 2009

    Posted 06 Dec 2011 Link to this post

    Hello,
    I noticed this change here: http://www.telerik.com/products/aspnet-ajax/whats-new/release-history/q2-2011-version-2011-2-712.aspx

    We were previously using this property so that our insert item would show at all times.  In this case, our RadListView should have the InsertItemTemplate exposed at all times but after upgrading from the Q1 to Q2 release, the fix which disables this behavior in Q2 changes the way the ListView control performs.  What is the recommended way to always show the InsertItemTemplate?  We have several pages which are using several instances of the RadListView control, all of which we want the InsertItem available at all times.

    Thanks,
    Ben
  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 08 Dec 2011 Link to this post

    Hi Ben,

    The recommended approach is to always check if RadListView.InsertItem is null and then call ShowInsertItem(), for example in PreRender:

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (RadListView1.InsertItem == null)
        {
            RadListView1.ShowInsertItem();
        }
    }

    Veli
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 15 May 2012 Link to this post

    This doesn't work for me - the InsertItemTemplate is never shown. What am I missing?

    <telerik:RadListView runat="server" ID="lvSuspend" ItemPlaceholderID="CustomersContainer"
        AllowMultiItemEdit="true" InsertItemPosition="LastItem"
        onprerender="lvSuspend_PreRender">
        <LayoutTemplate>       
            LAYOUT
            <asp:PlaceHolder ID="CustomersContainer" runat="server" />
        </LayoutTemplate>
        <EmptyDataTemplate>
            EMPTY
        </EmptyDataTemplate>
        <ItemTemplate>
          ITEM     
        </ItemTemplate>
        <InsertItemTemplate>
            INSERT
        </InsertItemTemplate>  
    </telerik:RadListView>
  5. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 15 May 2012 Link to this post

    The answer is binding to null. There seems to be difference with the Telerik List View and the ASP one wrt Insert/Empty template.

    When binding to null/empty collection using DataBind():

    ASP:
    • Shows Layout Template
    • Show Insert Template
    • Doesn't show Empty Template

    Telerik:
    • Shows Empty template only

    The Insert Item will only appear for the Telerik List View when binding to an empty collection with above Pre_Render code.

Back to Top