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

ShowInsertItem and EmptyDataItem

1 Answer 81 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Alain
Top achievements
Rank 1
Alain asked on 27 Mar 2012, 12:24 PM
Hello

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,
Alain

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 30 Mar 2012, 04:45 PM
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,
Tsvetina
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.
Tags
ListView
Asked by
Alain
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or