May 18, 2025, 08:16:40 PM

See more Support incidents in our old archived forum.

Author Topic: Enter/Exit Edit mode in code behind  (Read 4384 times)

dniezgoda

  • Customers
  • Newbie
  • *
  • Posts: 35
Enter/Exit Edit mode in code behind
« on: August 04, 2021, 08:15:04 AM »
Hi Team,

Is there any way to enter/exit edit mode from code behind for specific column cell?
eg. Enter edit mode for Name column right after adding new row to the gantt

Thank you in advance!

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Enter/Exit Edit mode in code behind
« Reply #1 on: August 05, 2021, 10:28:06 AM »
Hi dniezgoda,

Provide the unique cell class name to the column that you want to edit programmatically,

Code: [Select]
{
    field: "Activity_M().ActivityName_M()",
    title: "Activity Name",
    width: 150,
    cellClass: "nameCol",
    editor: RadiantQ.Default.Template.ProjectGanttExpandableTextboxEditor(),
    template: RadiantQ.Default.Template.ProjectGanttExpandableTextBlockTemplate()
}

And then get that specific column from the newly added activity view to make the cell into edit mode.

Code: [Select]
$("#addRow").click(function () {
    var newTask = getNewTask();
    ganttControl.AddNewItem(newTask);

    setTimeout(function () {
        var actView = ganttControl.ActivityViews[ganttControl.ActivityViews.length - 1];
        ganttControl.$ganttWrapper.data("GanttRowselectable").selectedItems.clear();
        // Select the row before start editing
        ganttControl.AddSelectedItem(actView);
        var $tr = ganttControl.grid.GetRowFromData(actView)
        var $td = $("td.nameCol", $tr);
        // To edit the cell
        ganttControl.grid.editCell($td);
    }, 100);
});

Thanks
Raja
« Last Edit: August 05, 2021, 10:46:18 AM by Rajagopal »

dniezgoda

  • Customers
  • Newbie
  • *
  • Posts: 35
Re: Enter/Exit Edit mode in code behind
« Reply #2 on: August 11, 2021, 08:34:48 AM »
it works like a charm!
Thanks a lot for your quick support.

dniezgoda

  • Customers
  • Newbie
  • *
  • Posts: 35
Re: Enter/Exit Edit mode in code behind
« Reply #3 on: October 18, 2021, 05:29:27 PM »
one more thing, could you pls help me to commit a editing cell (Name column) from code behind?
For example:
When user create a new task and naming it but not hit Enter key to commit change instead he press a shotcut key to run another action.
In this case, the editing text cannot be commited to name column

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Enter/Exit Edit mode in code behind
« Reply #4 on: October 19, 2021, 03:59:13 PM »
Hi, We are looking on this, will update you soon.

Thanks,
Raja

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 182
Re: Enter/Exit Edit mode in code behind
« Reply #5 on: January 17, 2022, 02:59:21 PM »
We sent you the updated sample to your email. Please check and confirm it.