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

Runtime Executed Ajax Manager Does Not Postback or Update RadGrid

1 Answer 67 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 19 Mar 2009, 02:17 PM
I have a RadGrid on a page that contains a custom ImageButton control in the first column of each row. When I press the button I call the following javascript function:

    function AddDetailRowButtonClicked(id) 
    { 
        var ajaxManager = $find("<%= RadAjaxDetailManager.ClientID %>"); 
        ajaxManager.ajaxRequest(id); 
    } 

What I want to do when this button is pressed is a) save any data that may have already been entered into the grid and b) add a row based on the saved data to the RadGrid's DataSource and rebind it.

So if the table has two rows and they click the button I want to add a third row on the server and have that be added to the grid after the partial page postback.

I'm having two problems. The first is that the data entered client-side is not accessible from the server-side instance of the grid so I cannot save that data. The data does appear if I put a simple button on the page that forces the whole page to postback. Why does it not work here?

The second problem is that when I rebind the grid server-side with a new row those changes are not reflected on the client. Is there something special I have to do to update the grid when using the Ajax Manager?

Thank you.

1 Answer, 1 is accepted

Sort by
0
SamJ
Top achievements
Rank 1
answered on 22 Mar 2009, 12:57 AM
Hi Andrew,

You maybe missed the setting in the RadAjaxManager where the manager updates the grid:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 

Was that the issue?

Thanks,
SamJ
Tags
Ajax
Asked by
Andrew
Top achievements
Rank 1
Answers by
SamJ
Top achievements
Rank 1
Share this question
or