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
davidwsk said:When the user press "Enter" key, the field just exit edit mode but not go to the next line within the textbox.
Hello David,
With the suggested manner above the user will be able to edit a cell and when the text of the cell reaches the end automatically the cursor is pushed to the next line and it is not needed the user to press enter. But if you want to do that on enter press or you want to implement custom logic and so on you can use provided by the grid client - side evnt handlers.
Please provide and example of how you would use the client side event handlers to allow the user to press the enter key to add a a new line to the text. Changing the textmode to Multiline just allows for WRAPPING, which is NOT the same as true multi-line editing. The fact that the editor doesn't support or allow true multi-line editing (with the user able to add multiple lines by hitting the enter key) is absurd. If you are going to propose a work around to your products gross limitations, please have the courtesy to provide an example of how you would implement such a work around for such a basic missing feature.
Praveena,
Using the Visual Studio debugger or the debugger built into IE8, please find exactly what line the script is failing on and what is null and let me know what you find.
Let me know if you have any questions with this matter.
Hi,
I have attached the error image and the code also along with this forum. Kindly check and correct the changes. Whether there is a event like onkeypress in the TextBoxProvider?
Thanks in Advance.
What is the value of editor when you get the exception if you look at the value in the watch window?
My expectation is that editor is an html textarea element and you should be able to wire up the keypress instead of the key down if you wish.
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.
Hello Praveen,
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
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.