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

Ajax Rebind Grid

1 Answer 72 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 04 Jul 2012, 02:22 PM
I have a grid that opens up a fancybox on a nested item, it updates the tables and then when the fancybox closes the grid should reload the datasource and rebind.
JS
$("a.verifyAnalyst").fancybox({
    'width': '100%',
    'height': '100%',
    'autoScale': true,
    'transitionIn': 'none',
    'transitionOut': 'none',
    'type': 'iframe',
    'onClosed': function() {
                    $find("<%=WIPAjaxManager.ClientID%>").ajaxRequest("Rebind");
                }
});
Code Behind
protected void WIPAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    if (e.Argument == "Rebind")
    {
        WorkInProgressMainGrid.MasterTableView.SortExpressions.Clear();
        WorkInProgressMainGrid.MasterTableView.GroupByExpressions.Clear();
        WorkInProgressMainGrid.Rebind();
    }
}
The problem is that is actually calling the rebind, but the grid doesn't update, then when I click on any other button I get the following error:
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I can't see why this is happening? Other Rebinds using onClick events are working 100%.

Can someone please advise me on how to reload the grid on closing of a fancybox.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Jul 2012, 05:19 PM
Hello,

Please set below propety in page directory/Tag.
<%@ Page EnableEventValidation="false" %>
// OR
<%@ Page EnableEventValidation="true" %>


Thanks,
Jayesh Goyani
Tags
Ajax
Asked by
Jako
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or