How to prevent editing of Cell on double click

1 posts, 0 answers
  1. Hardik
    Hardik avatar
    8 posts
    Member since:
    Jan 2017

    Posted 04 Sep 2017 Link to this post

    I have Radgrid with multiple columns with one column as RadEditor.

    My issue is when I double click on cell, I need to check condition first and if condition does not match I need to prevent editor to open in edit mode. Here I have attached OnRowDblClick function:

     

    function RowDblClick(sender, eventArgs) {
                        var columnName = "MultiRow";
                        if (!checkIsMultiLineAllowed(columnName)) {
                            eventArgs._domEvent.preventDefault();
                            return;
                        };

                        var isEnabled = GetToolbarButtonState("Editselected");
                        if (isEnabled) {
                            editedRow = eventArgs.get_itemIndexHierarchical();
                            console.log(editedRow);
                            if (Telemetry.DoTracking(accoTOOLTrackingLevel, "Verbose")) {
                                Telemetry.TrackTrace(Telemetry.severityLevel.Verbose, "Edit Mode: " + '<%=accoADEGrid.MasterTableView.EditMode.ToString() %>' + " | Edit Row Index: " + editedRow + " | ConfigurationID: " + '<%=HF_accoTOOLConfigurationID.Value %>', AITrackingProperties, "RowDblClick", "");
                            } else if (Telemetry.DoTracking(accoTOOLTrackingLevel, "Information")) {
                                Telemetry.TrackTrace(Telemetry.severityLevel.Verbose, "Edit Mode: " + '<%=accoADEGrid.MasterTableView.EditMode.ToString() %>' + " | Edit Row Index: " + editedRow, AITrackingProperties, "RowDblClick", "");
                            }

                            $find("<%= accoADEGrid.ClientID %>").get_masterTableView().editItem(editedRow);
                            console.log($find("<%= accoADEGrid.ClientID %>"));
                        }
                    }

     

    I need to prevent further proccess to stop. I tried eventArgs._domEvent.preventDefault(), but it is not working

Back to Top