ListView Display Message when empty
Hi,
I have a ListView populated by a custom adaptor and I want to display a message when there are no entites. How can I accomplish that?
My ListView looks like this:
<SfListView TValue="Entity" HeaderTitle="Title" ShowCheckBox="false" ShowHeader="true" Height="75vh/*")" Query="new Query().Where(nameof(EntityList.Id), nameof(Operator.Equal).ToLowerInvariant(), currentEntity?.Id)">
<SfDataManager AdaptorInstance="@typeof(SimpleODataAdaptor<ServiceOrder>)" Adaptor="Adaptors.CustomAdaptor" />
<ListViewFieldSettings TValue="Entity" Id="@nameof(Entity.Id)" Text="@nameof(Entity.Title)" />
<ListViewTemplates TValue="Entity" >
<Template>
...
</Template>
</ListViewTemplates>
</SfListView>
Best regards
Daniel
|
public void created()
{
if (serviceAdapter.Entities.Count() == 0)
{
msg = "List Items are empty";
}
} |
Hi,
thank you for your help but that's not really what I was looking for.
Clarification: I have this ListView with a given height of 50vh and I want to display the message in the middle of the ListView. I also cannot use the Entites property of the custom adaptor directly because the ListView also has a where Query. How can I achieve that under the given circumstances?
Best regards
Daniel
We are currently validating your reported scenario to check whether empty data source is present in ListView. We will provide further validation details within three business days on June 25th , 2021.
Hi,
great, thank you very much for your help.
Best regards
Daniel
- 6 Replies
- 3 Participants
- Marked answer
-
DA Daniel
- Jun 17, 2021 02:02 PM UTC
- Jun 29, 2021 09:57 AM UTC