Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
MultiLine TextBox and RowEditing
posted

Hello,

I have a WebDataGrid (and WebHierarchicalDataGrid) with EditingCore and RowEditing activated. One of the cells is a multiline text which I would like to edit (and being able to add new lines by pressing enter). However, by default, Enter closes the EditingMode.

So, first of all I added the following Editor:

<EditorProviders>

<ig:TextBoxProvider ID="NewsTextEditor">

<EditorControl ID="NewsTextEditor" ClientIDMode="Predictable" TextMode="MultiLine"></EditorControl>

</ig:TextBoxProvider>

</EditorProviders>

And assigned it to the RowEditing-ColumnSettings for the particular Field. Now, I found a solution in the forum if one uses the CellEditing by doing the following:

function WebHierarchicalDataGrid1_CellEditing_ExitingEditMode(sender, eventArgs) {

    if (eventArgs.getCell().get_column().get_key() == "NEWS_TEXT") {

       if (eventArgs.get_browserEvent().keyCode == 13) {

          eventArgs.set_cancel(true);

            }

      }

}

However, when using RowEditing, There is no eventArgs.getCell(), and even if I would ignore the column check and just cancle the Event every time:

function WebHierarchicalDataGrid1_RowEdit_ExitingEditMode(sender, eventArgs) {

    if (eventArgs.get_browserEvent().keyCode == 13) {

       eventArgs.set_cancel(true);

       eventArgs.set_keepEditing(true);

        }

}

it does not add a new line to the text. What can I do to use multiline Editors with the RowEditing Behaviour?

Thanks a lot!