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

Empty Content Template

2 Answers 64 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anagh
Top achievements
Rank 2
Anagh asked on 03 Aug 2014, 01:18 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 06 Aug 2014, 04:49 PM
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,
Ves
Telerik
 

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.

 
0
Anagh
Top achievements
Rank 2
answered on 18 Aug 2014, 03:42 PM
Thank you very much for the answer.
Tags
DataBoundListBox
Asked by
Anagh
Top achievements
Rank 2
Answers by
Ves
Telerik team
Anagh
Top achievements
Rank 2
Share this question
or