Empty Content Template

Thread is closed for posting
3 posts, 1 answers
  1. Anagh
    Anagh avatar
    7 posts
    Member since:
    Jul 2013

    Posted 03 Aug 2014 Link to this post

    I have a RadDataBoundListBox which has an EmptyContentTemplate. The EmptyContentTemplate contains a progress bar indicator. So when I jumps to the page (which contains the RadDataBoundListBox), progress indicator is shown, data is loaded from internet and I get the data in the listbox, everything works just fine. But if somehow data isn't loaded from internet (due to network connection problem or an exception), data isn't loaded in the listbox. And I still see the progress indicator which is in the EmptyContentTemplate. How can I change this? I mean if somehow data isn't loaded, I do not want to show the progress indicator. I want to show some text. 
    How can I achieve this kind of behaviour?
    Thanks in advance.

    P.S. : I am not using MVVM.
  2. Answer
    Ves avatar
    2916 posts

    Posted 06 Aug 2014 Link to this post

    Hi Anagh,

    You can update the EmptyContentTemplate of RadDataBoundListBox in the DataRequested event handler, once you've realized that there is no data coming:

    (sender as RadDataBoundListBox).EmptyContentTemplate = this.Resources["noDataMessageTemplate"] as DataTemplate;

    Best regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Anagh
    Anagh avatar
    7 posts
    Member since:
    Jul 2013

    Posted 18 Aug 2014 in reply to Ves Link to this post

    Thank you very much for the answer.
Back to Top