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

RadGrid double click event not firing

3 Answers 246 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew Currie
Top achievements
Rank 1
Andrew Currie asked on 24 Jun 2010, 08:58 AM
Hi,

I wish to capture both the single click and double click events of a RadGrid row.  Each row in my table shows the metadata of a document (author, date etc).  When the user clicks on the row it shows the document in an iframe, next to the Grid.  I would like it so that in addition, if the user double click the row, it opens up a new window which displays the document full screen.  However, I find that the double click event is not firing due to the setting the src of the iframe.  If I don't include that line of code then both the click doubleclick events fire as expected.

Why does the double click event not fire in this scenario and how do I get around this?

Thanks

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Jun 2010, 04:24 PM
Hello Andrew,

Based on the provided information it is hard to determine the exact cause for the problem you are facing. Could you paste your aspx and code-behind (please, use the code-formatter tool of the ticket editor).

Sincerely yours,
Pavlina
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
0
Jay Leffue
Top achievements
Rank 1
answered on 27 Sep 2010, 02:58 PM
I'm having something similar.  I have a grid with a child grid that populates through ajax on RowSelected.  So the single click RowSelected fires off the AjaxManager to update the child grid.

I also have the parent grid set on doubleClick to direct to a different url.  The issue is that if the user does not double click fast enough (a timing issue) then the RowSelected is registered and the application never sees the double click.  Its finicky but enough of a hassle to make both on one grid seem undoable for a releasable product.  Is there a way around this so I can have both on one grid in this manner or is it one or the other?
0
Andrew Currie
Top achievements
Rank 1
answered on 27 Sep 2010, 03:19 PM
I found it depends on the action being taken.

The Single-Click and Double click events do both fire.  For my project, I wanted to update an iframe on single click and on double click open a new window.  The location of the iframe and new window were the same URL.  The idea being single click to "preview" and double-click to get "Full screen".

In this scenario, I had to put a javascript timeout within the single click on updating the iframe.  The majority of code I could fire straight off but when it came to actually setting the iframe I had to setup a timeout.  Updating the iframe straight away was effectively cancelling the double click.  The idea being that the timeout would be long enough incase the user double-click yet short enough that the user doesn't notice too much (I did change the UI later - but this is the only way I could get this technology to work in this way).

Javascript code of single_click below.  As I say this is changed from the original but I have left the comment in the code.


                            function GridRecordList_OnRowClick(sender, eventArgs) {
                                RefreshDocumentPane(sender, eventArgs.get_itemIndexHierarchical());
                            }

                            function RefreshDocumentPane(grid, selectedIndex) {
                                var iframe = document.getElementById("<%=DocumentFrame.ClientID %>");
                                var MasterTable = grid.get_masterTableView();
                                var row = MasterTable.get_dataItems()[selectedIndex];
                                var cell = MasterTable.getCellByColumnUniqueName(row, "SourceRecordID");
                                var RecordID = cell.innerHTML;
                                cell = MasterTable.getCellByColumnUniqueName(row, "ApplicationID");
                                var ApplicationID = cell.innerHTML;
                                var targetURL = "PleaseWait.htm?RecordID=" + RecordID + "&ApplicationID=" + ApplicationID;
                                
                                // refresh the menu for multiple documents per record
                                cell = MasterTable.getCellByColumnUniqueName(row, "DocumentCount");
                                var DocCount = cell.innerHTML;
                                InitDocumentsMenu(DocCount, RecordID, ApplicationID);

// If double_click grid event required then put this next line in a setTimeout incase user wishes to double click.
// Cancel the timeout in the double click event.
                                iframe.src = targetURL;
                            }
Tags
Grid
Asked by
Andrew Currie
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Jay Leffue
Top achievements
Rank 1
Andrew Currie
Top achievements
Rank 1
Share this question
or