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.
Hi,
It is giving the error in the javascript itself in the below code .
editor.onkeydown = function (e) {
if (e == null)
e = event;
// don't cancel the event if the backspace or delete key was pressed.
if (e.keyCode == 8 || e.keyCode == 46)
return true;
// cancel the event if the length of the editor is 4 or more.
if (editor.value.length >= 4)
return false;
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.
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.
Can you explain with the example for this scenerio.
I want to accept only 4 characters in TextBoxProvider with multiline property.
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.