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

iPad and OnRowClick

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Reuben
Top achievements
Rank 1
David Reuben asked on 12 Jan 2013, 01:19 AM
I can get the OnRowDblClick event working just fine on an iPad, but the OnRowClick event never seems to fire. The code works just fine in IE and Chrome, but why won't the OnRowClick fire on an iPad:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
...
<script type="text/javascript">
function gridClick(sender, eventArgs) {
 alert('click');
}
function gridDoubleClick(sender, eventArgs) {
 alert('double click');
}
</script>
...
<telerik:RadScriptManager ID="trsm" runat="server" />
<telerik:RadGrid
 ID="grid"
 runat="server"
 AllowFilteringByColumn="True"
 AllowPaging="True"
 AllowSorting="True"
 AutoGenerateColumns="False"
 CellSpacing="0"
 DataSourceID="XXXXX"
 GridLines="None"
 Skin="Default">
 <GroupingSettings CaseSensitive="False" />
 <MasterTableView DataKeyNames="XXXXX" ClientDataKeyNames="XXXXX" DataSourceID="XXXXX">
  <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
   <HeaderStyle Width="20px"></HeaderStyle>
  </RowIndicatorColumn>
  <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
   <HeaderStyle Width="20px"></HeaderStyle>
  </ExpandCollapseColumn>
  <Columns>
   ...
  </Columns>
 </MasterTableView>
 <FilterMenu EnableImageSprites="False"></FilterMenu>
 <clientsettings EnableAlternatingItems="true" EnableRowHoverStyle="True">
  <selecting AllowRowSelect="True" />
  <clientevents OnRowClick="gridClick" OnRowDblClick="gridDoubleClick" />
 </clientsettings>
</telerik:RadGrid>
...

2 Answers, 1 is accepted

Sort by
0
David Reuben
Top achievements
Rank 1
answered on 12 Jan 2013, 03:02 PM
After a log of digging, I tried replacing OnRowClick with OnRowSelected, and this seems to works across all browsers... including the iPad. Is this the correct solution?
0
Marin
Telerik team
answered on 16 Jan 2013, 12:25 PM
Hello,

 Handling the RowSelected event is also an acceptable workaround. Currently when both RowDblClick and RowClick are handled only the RowDblClick fires. If you remove the RowDblClick the RowClick will fire normally. This is a result of an additional improvement that simulates double click / tap events on touch devices which are not supported out of the box. We will try to improve this behavior for future releases. For now you can use the RowSelected event.

Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
David Reuben
Top achievements
Rank 1
Answers by
David Reuben
Top achievements
Rank 1
Marin
Telerik team
Share this question
or