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"> <img src="../images/icons/add-16x20.gif" border="0" /> Add New Record </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> |