ShowInsertItem and EmptyDataItem

2 posts, 0 answers
  1. Alain
    Alain avatar
    33 posts
    Member since:
    Feb 2009

    Posted 27 Mar 2012 Link to this post


    System: ASP.NET AJAX v2012.1.215.40
    Visual Studio 2010

    We use DatasourceID property and the ShowInsertItem() function of RadListView to display at the same time the data by  <ItemTemplate> and the insertion by <InsertItemTemplate>. Everything works fine, except when the data are empty. In this case, the content of <EmptyDataTemplate> isn't displayed if ShowInsertItem() is used.
    If the <ItemTemplate> can be displayed at the same time that <InsertItemTemplate>, the display of
    <EmptyDataTemplate> should follow the same logic.

    Is there an option to force the display of <EmptyDataTemplate> while the <InsertItemTemplate> is showed?

    Best regards,
  2. Tsvetina
    Tsvetina avatar
    1861 posts

    Posted 30 Mar 2012 Link to this post

    Hello Alain,

    This is intended behavior of the control, the idea is that once you have an insert from, the control is no longer empty. If you want to have different appearance in this scenario, you can specify it in the InserItemTemplate, initially invisible, on PreRender to check the item count in the control and if it is 0, to show this specific part of the template.

    All the best,
    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. DevCraft R3 2016 release webinar banner
Back to Top