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

[Solved] Loading panel from code

2 Answers 184 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
apb
Top achievements
Rank 1
apb asked on 20 May 2009, 04:54 PM
Hi,

I need to be able to construct the following control completely from C# code (not declaratively):

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="100%" Width="75px" Transparency="50">

  <table style="height: 100%; width: 100%" border="0">

    <tr>

      <td width="100%" align="center" valign="middle">

        <img src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading2.gif") %>' alt="" style="border: 0px;" />

      </td>

    </tr>

  </table>

</telerik:RadAjaxLoadingPanel>

 


Any ideas?  I can find no way to access the template portion of the RadAjaxLoadingPanel from code.

-Al

 

 

 

 

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 21 May 2009, 10:24 AM
Hello Al,

You should add the image (nested in table or not)  to the controls collection of the RadAjaxLoadingPanel:
RadAjaxLoadingPanel radAjaxLoadingPanel1 = new RadAjaxLoadingPanel(); 
radAjaxLoadingPanel1.ID = "radAjaxLoadingPanel1"
radAjaxLoadingPanel1.Height = Unit.Percentage(100); 
radAjaxLoadingPanel1.Width = Unit.Pixel(75); 
radAjaxLoadingPanel1.Transparency = 50; 
 
Image img = new Image(); 
img.ImageUrl = RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading2.gif"); 
 
radAjaxLoadingPanel1.Controls.Add(img); 
PlaceHolder1.Controls.Add(radAjaxLoadingPanel1); 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
apb
Top achievements
Rank 1
answered on 22 May 2009, 01:07 PM
Thanks. 

What had me fooled was that, when create declaratively, RadAjaxLoadingPanel1.Controls.Count is zero when examined in the debugger.

I figured the template must be stored somewhere else.

Incidentally, why is the controls count zero on the declaratively created one? 

-Al
Tags
Ajax
Asked by
apb
Top achievements
Rank 1
Answers by
Daniel
Telerik team
apb
Top achievements
Rank 1
Share this question
or