Welcome Guest Search | Active Topics | Sign In | Register

Grid Event After User Hit "Enter" Options
Darren
Posted: Wednesday, July 11, 2012 2:35:28 AM
Rank: Newbie
Groups: Member

Joined: 3/3/2012
Posts: 8
Hi Support,

How to get the events in C# when user hit the "Enter" key after edit a value in Grid?
Coz i would like to save the data into database after user hit the "Enter" key.
Thanks.

Regards,
Darren
eo_support
Posted: Wednesday, July 11, 2012 1:35:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

The only thing the Grid triggers after enter key is the column's ClientSideAfterEdit event. You must handle this event with JavaScript. Inside your JavaScript handler you can proceed to trigger a server event, that part no longer has anything to do with the Grid. We have a ScriptEvent control that allows you to trigger server event from JavaScript, you can take a look of that control for this part.

When you trigger server event from ClieentSideAfterEdit event, make sure you trigger it with a delay. For example, the following code triggers without a delay and it won't work:

Code: JavaScript
function your_client_side_end_edit_handler()
{
    your_code_to_trigger_server_event();
}

Instead you would use it this way:

Code: JavaScript
function your_client_side_end_edit_handler()
{
    setTimeout(function()
    {
        your_code_to_trigger_server_event();
    }, 10);
}

Hope this helps. Please let me know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.