Hi All,
Is there a way to enable user to input MultiLine in a text field?
I tried TextBoxProvider and TextEditorProvider both seems not working.
When the user press "Enter" key, the field just exit edit mode but not go to the next line within the textbox.
Thanks!
David
Hello Praveen,
Please let me know if I can provide any further assistance regarding this matter.
To prevent the cell from existing edit mode when tab is pressed, Webdatagrid's KeyDown and cell exiting edit mode clients side events needs to be handled like below
function WebDataGrid1_Grid_KeyDown(sender, eventArgs) { var editedColumn = ""; if (sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_cellInEditMode() != null ) { editedColumn = sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_cellInEditMode().get_column().get_key(); } if (editedColumn == "Name") { if (eventArgs.get_browserEvent().keyCode == 9 || eventArgs.get_browserEvent().keyCode == 13) { eventArgs.set_cancel(true); }}} function WebDataGrid1_CellEditing_ExitingEditMode(sender, eventArgs) { if (eventArgs.getCell().get_column().get_key() == "Name") { if (eventArgs.get_browserEvent().keyCode == 9 || eventArgs.get_browserEvent().keyCode == 13) { eventArgs.set_cancel(true); }}}
{ var editedColumn = "";
if (sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_cellInEditMode() != null ) {
editedColumn = sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_cellInEditMode().get_column().get_key();
}
if (editedColumn == "Name") {
if (eventArgs.get_browserEvent().keyCode == 9 || eventArgs.get_browserEvent().keyCode == 13) {
eventArgs.set_cancel(true);
}}}
function WebDataGrid1_CellEditing_ExitingEditMode(sender, eventArgs)
{
if (eventArgs.getCell().get_column().get_key() == "Name") {
Attached sample demonstrates the same.
The have tried to cancel the event when the tab key is pressed but the cell is exiting from the editmode. So, I am currently discussing with our Development team regarding this matter and I will update you by the end of the day tomorrow with the progress.
Please let me know if you have any further questions regarding this matter
Hi,
Like a multiline when the tab key is pressed inside the particular column cancel the event and it should work as a tab in the notepad.
Please do the needful.
Thanks in Advance.
Hello Praveena,
I would recommend you to use TextEditorProvider as shown below:
<EditorProviders> <ig:TextEditorProvider ID="WebDataGrid1_TextEditorProvider1"> <EditorControl ClientIDMode="Predictable" MaxLength="4" MultiLine-Rows="4" TextMode="MultiLine"> </EditorControl> </ig:TextEditorProvider> </EditorProviders>
This will limit number of character to 4, It is not needed to write any custom code.
I hope this helps.