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

Select Cell Contents in Edit Mode

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 09 Feb 2013, 03:40 PM
When a cell changes to edit mode the cursor is set at the beginning of the cell contents.

Here the ajax function:

function RowDblClick(sender, eventArgs) {
               editedRow = eventArgs.get_itemIndexHierarchical();
               $find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
           }

How can I select the cell contents at the time the cell goes into Edit mode?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 14 Feb 2013, 09:39 AM
Hi Laura,

You can use the following two client-side events to achieve the desired behavior:
<ClientSettings>
    <ClientEvents OnCommand="gridCommand" OnRowCreated="rowCreated" />
</ClientSettings>
JavaScript:
function gridCommand(sender, args) {
    if (args.get_commandName() == "Edit") {
        var editIndex = parseInt(args.get_commandArgument());
        // execute custom logic
    }
}
function rowCreated(sender, args) {
    if (args.get_item().get_isInEditMode()) {
        var editForm = args.get_item().get_editFormItem();
        // execute custom logic
    }
}

I hope this will prove helpful.

All the best,
Eyup
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
Laura
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or