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

Crosspage page postback on double click

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James Daresta
Top achievements
Rank 1
James Daresta asked on 01 Apr 2010, 03:59 PM
I am having trouble trying to do a crosspage postback when a user double clicks on a grid row. Using the example found at

http://www.telerik.com/support/kb/aspnet-ajax/grid/performing-postback-from-grid-client-events.aspx I did the following for my aspx page. I think the issue is using the ajax manager with the grid. I want the ajax manage for all the other events such as paging, sorting, etc., but not for the client double click which I want to do a full postback with a the postback url being another page.

   <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
            function refreshGrid(arg) {  
                if (!arg) {  
                    $find("<%= ramCustomerProfileList.ClientID %>").ajaxRequest("Rebind");  
                }  
                else {  
                    $find("<%= ramCustomerProfileList.ClientID %>").ajaxRequest("RebindAndNavigate");  
                }  
            }  
 
            function rowDblClick(sender, eventArgs) {  
                aspnetForm.action = "CustomerProfile.aspx";  
                __doPostBack("<%= rgCustomerProfileList_CustomerProfiles.UniqueID %>", "RowDblClicked:" + eventArgs.get_itemIndexHierarchical());  
            }  
              
        </script> 
    </telerik:RadCodeBlock>   
 
<telerik:RadAjaxManager ID="ramCustomerProfileList" runat="server" OnAjaxRequest="ramCustomerProfileList_AjaxRequest">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="rgCustomerProfileList_CustomerProfiles">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="rgCustomerProfileList_CustomerProfiles" LoadingPanelID="ralpCustomerProfileList_LoadingPanel" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting>   
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
        <telerik:RadAjaxLoadingPanel ID="ralpCustomerProfileList_LoadingPanel" runat="server">  
        </telerik:RadAjaxLoadingPanel> 
    <telerik:RadGrid ID="rgCustomerProfileList_CustomerProfiles" runat="server"   
        AllowFilteringByColumn="True"   
        AllowPaging="True"   
        AllowSorting="True"   
        AutoGenerateColumns="False"   
        GridLines="None"   
        ShowGroupPanel="True" 
        OnNeedDataSource="rgCustomerProfileList_CustomerProfiles_NeedDataSource" 
        > 
<MasterTableView  
        DataKeyNames="CustomerId"   
        ClientDataKeyNames="CustomerId" 
        CommandItemDisplay="Top" 
        CommandItemSettings-ShowExportToCsvButton="true" 
        PageSize="20" 
        > 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
 
<CommandItemSettings ShowExportToCsvButton="True"></CommandItemSettings> 
    <Columns> 
        <telerik:GridBoundColumn DataField="AccountName" HeaderText="Account Name"   
            UniqueName="AccountName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn HeaderText="Parent Company" UniqueName="ParentCompany" DataField="ParentCompany.Name">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="AccountManagerName"   
            HeaderText="Account Manager" UniqueName="AccountManagerName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City">  
        </telerik:GridBoundColumn> 
    </Columns> 
   <CommandItemTemplate> 
    <asp:LinkButton ID="btnAddNewRecord" runat="server"   
           onclick="btnAddNewRecord_Click" PostBackUrl="~/CustomerProfile/CustomerProfile.aspx">&nbsp;<img src="../images/icons/add-16x20.gif" border="0" />&nbsp;Add New Record&nbsp;</a></asp:LinkButton>   
   </CommandItemTemplate> 
    <NoRecordsTemplate> 
    No Records      
    </NoRecordsTemplate> 
</MasterTableView> 
        <ClientSettings AllowDragToGroup="True" Resizing-AllowColumnResize="true">  
            <Selecting AllowRowSelect="True" /> 
            <Scrolling AllowScroll="True"   
            UseStaticHeaders="True" /> 
            <ClientEvents OnRowDblClick="rowDblClick" /> 
        </ClientSettings> 
      
      
    </telerik:RadGrid> 

 

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 06 Apr 2010, 04:01 PM
Hello James,

Please review the below articles on how to disable ajax conditionally and how to redirect to another page with ajax:

http://www.telerik.com/help/aspnet-ajax/ajxexclude.html
http://www.telerik.com/help/aspnet-ajax/ajxredirectingtoanotherpage.html

Check it out and let me know if any issues arise.

All the best,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
James Daresta
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or