Hi,
I have problem with ajax postback. Is possible to cancel ajax postback after refresh grid.
I have grid and I use this code:
But problem is, that I refresh grid, all page codebehind are called. Not only webservice (use it for reading data).
In PageLoad I use
Grid
Problem is, that I don't set combos data and property, then I receive blank controls after ajax.
Ajax framework set my controls, but I don't want it.
Thanks for answer.
Roman Krsko
I have problem with ajax postback. Is possible to cancel ajax postback after refresh grid.
I have grid and I use this code:
function RefreshGrid(search) { if (search != "") { document.getElementById("search").value = search; var masterTable = $find("<%= grdResult.ClientID %>").get_masterTableView(); masterTable.rebind(); }}function requestStart(sender, eventArgs) { document.getElementById("ajaxrequest").value = "true";}function responseEnd(sender, eventArgs) { document.getElementById("ajaxrequest").value = "false";}But problem is, that I refresh grid, all page codebehind are called. Not only webservice (use it for reading data).
In PageLoad I use
sAjaxRequest = Request.Params["ajaxrequest"] + "";if (sAjaxRequest != "true"){ //... loading controls and set property from DB (radcombo, radgrid, ...)}Grid
<telerik:RadGrid ID="grdResult" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" onitemdatabound="grdResult_ItemDataBound" PageSize="20" Width="100%" DataSourceID="GridDataSource" BorderStyle="None"> <PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="10" /> <ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="true"> <DataBinding EnableCaching="true" /> <Selecting AllowRowSelect="true" /> <ClientEvents /></ClientSettings> <HeaderContextMenu enableautoscroll="True"></HeaderContextMenu> <MasterTableView> <Columns> <telerik:GridBoundColumn DataField="Manufacturer" HeaderText="Manufacturer" UniqueName="colManufacturer"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Stock" DataFormatString="{0:0}" HeaderStyle-HorizontalAlign="Right" HeaderText="Stock" ItemStyle-HorizontalAlign="Right" UniqueName="Stock"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Price" HeaderStyle-HorizontalAlign="Right" HeaderText="Price" ItemStyle-HorizontalAlign="Right" UniqueName="Price"></telerik:GridBoundColumn> </Columns> </MasterTableView></telerik:RadGrid><asp:ObjectDataSource ID="GridDataSource" runat="server" SelectMethod="FillResultGrid" TypeName="shop.Service"> <SelectParameters> <asp:FormParameter FormField="search" Name="sSearch" Type="String" /> </SelectParameters></asp:ObjectDataSource>Problem is, that I don't set combos data and property, then I receive blank controls after ajax.
Ajax framework set my controls, but I don't want it.
Thanks for answer.
Roman Krsko