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

RadAjaxManager With HTML table

1 Answer 124 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 24 May 2013, 04:36 PM
I have an application that dynamically builds an HTML table and populates it with data server side. (Why the designer did not us a repeater is food for another thread). I have the ability to change the date, and when i do so, the table is supposed to be re-built with the selected date's content.

Server side, the correct date is being passed, and it builds the table correctly. My AjaxLoadingPanel displays while the request is processing, but when the request completes, the original data is still showing... For the life of me i cannot figure out why.

Here is the requisite code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="txtDate">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblAttendance" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro">
</telerik:RadAjaxLoadingPanel>
<cc1:TabPanel ID="tabAttendance" runat="server" Height="150" HeaderText="Attendance">
                       <ContentTemplate>
                           <asp:Panel runat="server" ID="pnlAttendance" Width="900px">
                               <asp:Table ID="tblAttendance" EnableViewState="False" runat="server" class="ResultsTable"
                                   CellSpacing="0" border="0" Style="width: 880px; border-collapse: collapse;">
                               </asp:Table>
                               <br />
                               <asp:Button ID="btnAttendanceReturn" runat="server" Text="Return" Width="100px" Visible="False"
                                   OnClick="BtnReturnClick" />
                               <asp:Button ID="btnAttendanceSave" runat="server" Text="Save" Width="100px" Visible="False"
                                   OnClick="BtnAttendanceSaveClick" />
                           </asp:Panel>
                       </ContentTemplate>
                   </cc1:TabPanel>
private void GenerateAttendanceTable()
       {
           int counter = 0;
           int notesColWidth = 550;
           const string SRowStyle = "ResultsText";
           const string SRowStyleAlt = "ResultsTextAlt";
           tblAttendance.Rows.Clear();

      .... GET THE DATA .....

foreach(var tableRow in data.Rows)
{
      tblAttendance.Rows.Add(tableRow);
}

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 May 2013, 12:04 PM
Hi Sean,

I would suggest you to try wrapping the whole "tabAttendance" control into an asp Panel and add this panel to update itself in the RadAjaxManager settings.
Give this a try and verify if it works for you.


Regards,
Maria Ilieva
Telerik
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
Ajax
Asked by
Sean
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or