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

Grid rows don't close ordinarily if the batchEditClosing is cancelled

5 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
أشرف
Top achievements
Rank 1
أشرف asked on 06 Jan 2014, 04:21 PM
Greetings,

I have a batch mode grid that's required to be able to display a dialog when the user is editing a row, and the user will interact with the dialog in some way.
I used a RadWindow for the dialog, and because the grid closes the currently edited row if the user clicks outside the row, I added the following code to prevent the grid from closing the currently edited row while the dialog is shown:

function dialog_beforeShow(sender, args)
    {
        grid.add_batchEditClosing(grid_batchEditClosing);
    }
 
    function grid_batchEditClosing(sender, args)
    {
        args.set_cancel(true);
    }
 
function dialog_close(sender, args)
    {
        grid.remove_batchEditClosing(grid_batchEditClosing);
    }

After the dialog is closed, I find that the row doesn't close if I click with mouse anywhere.
It only closes if I open another row for editing.

5 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 09 Jan 2014, 11:27 AM
Hi Ashraf,

Since the event handler is detached you should not experience such behavior. Could you ensure that a JavaScript error is not present on the page that might be breaking the functionality? Additionally please share with us the contents of the problematic page so we could review the scenario more carefully.

Regards,
Angel Petrov
Telerik
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 the blog feed now.
0
أشرف
Top achievements
Rank 1
answered on 12 Jan 2014, 08:48 AM
I created a small website in which the problem is reproduced. You may download it from here.

  1. Run the application with the latest release of RadControls.
  2. Open any of the grid rows for editing.
  3. Move the focus to the "Name" cell, then press CTRL and E keys.
  4. The dialog will be shown. Watch your console.
  5. Click with the mouse inside the dialog, you will see some statements logged in the console on the first click.
  6. On the next clicks, nothing is logged. The batchEditClosing event handler is not called.
  7. Close the dialog, then click on anywhere on the page. the open line won't be closed.

The open line won't be closed until you open another line, or add a new line.

0
Accepted
Angel Petrov
Telerik team
answered on 16 Jan 2014, 07:42 AM
Hi Ashraf,

I have carefully examined the provided sample and after some debugging was able to find the cause of the problem. It seems that when the user clicks outside the grid the internal logic clears the currently edited row. This proves problematic as the when the OnBatchEditClosing event is canceled the row will stay in edit mode. Later when the user closes the window and clicks on the blank space RadGrid does not know which row to close.

I have already logged this problem into our system and hope that our dev team will be able to provide a fix for it as soon as possible. You can monitor our progress on the matter from this link.

As a token of gratitude for reporting this issue to us I have updated your Telerik points. Additionally please accept our apologies for any inconvenience this may have caused.

Regards,
Angel Petrov
Telerik
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 the blog feed now.
0
أشرف
Top achievements
Rank 1
answered on 16 Jan 2014, 08:47 AM
Greetings and thanks for your reply.

But I find it strange that the grid is able to close the line if I clicked on another line. It seems that this functionality doesn't depend on the currently edited row.

I tried setting the private _currentlyEditedRow member of the BatchEditingManager object to the currently open row, and this resolves the problem.
0
Angel Petrov
Telerik team
answered on 21 Jan 2014, 06:32 AM
Hi Ashraf,

Actually in the particular case it closes the edited row because it has to open another for edit. Since only one editor is created for every column the editors change their position when another row is clicked.

Regards,
Angel Petrov
Telerik
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 the blog feed now.
Tags
Grid
Asked by
أشرف
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
أشرف
Top achievements
Rank 1
Share this question
or