I have a grid with one editable column that have text editor provided. TextMode="MultiLine"... Right now it goes to the next line only when typing reaches right
end of the box. What I need is to configure it somehow so that it'll work as regular Text editor and goes to the next line when enter key pressed. Right now
when enter key pressed it leaves text box, I need to change that. Below grid's mark up. Please advise.
Thanks
<ig:WebDataGrid ID="wdgSuI" runat="server" AutoGenerateColumns="False" StyleSetName="Default" Height="520px" Width="1096px" DataKeyFields="idLR7GFSSurvDescr" DataMember="MiscInfo" onrowupdating="wdgSuI_RowUpdating" style="margin-left: 0px" > <Columns> <ig:BoundDataField DataFieldName="idLR7GFSSurvDescr" DataType="System.Int32" Hidden="True" Key="idLR7GFSSurvDescr"> <Header Text="BoundColumn_0" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Question" DataType="System.String" Key="Question" Width="35%"> <Header Text="Question" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="freeanswer" DataType="System.String" Key="freeanswer" Width="35%"> <Header Text="Answer/Explanation" /> </ig:BoundDataField> <ig:BoundCheckBoxField DataFieldName="Finalize" Key="Finalize" Width="15%"> <Header Text="Finalize"> </Header> </ig:BoundCheckBoxField> <ig:BoundCheckBoxField DataFieldName="Reject" Key="Reject" Width="15%"> <Header Text="Reject"> </Header> </ig:BoundCheckBoxField> </Columns> <EditorProviders> <ig:TextEditorProvider ID="wdgSuI_TextEditorProvider1"> <EditorControl ClientIDMode="Predictable" TextMode="MultiLine"> </EditorControl> </ig:TextEditorProvider> </EditorProviders> <Behaviors> <ig:EditingCore AutoCRUD="False" BatchUpdating="True"> <EditingClientEvents CellValueChanged="wdgSuI_Editing_CellValueChanged" CellValueChanging="wdgSuI_Editing_CellValueChanging" /> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Question" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="freeanswer" EditorID="wdgSuI_TextEditorProvider1" /> </ColumnSettings> <EditModeActions EnableOnActive="True" MouseClick="Single" /> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:Activation> </ig:Activation> </Behaviors> </ig:WebDataGrid>
Hello mcseidel,
Thank you for posting in the community.
What I can suggest for achieving your requirement is using the ExitingEditMode client side event of the WebDataGrid. In this event via its event arguments` browserEvent method it could be identified whether the event is fired from pressing the Enter button. If so the ExitingEditMode event is canceled and the cursor is going to go to the next line when the enter key is pressed. For example:
function WebDataGrid1_CellEditing_ExitingEditMode(sender, eventArgs) { if (eventArgs.get_browserEvent().keyCode == 13) { eventArgs.set_cancel(true); } }
function WebDataGrid1_CellEditing_ExitingEditMode(sender, eventArgs)
{
if (eventArgs.get_browserEvent().keyCode == 13) {
eventArgs.set_cancel(true);
}
I am also attaching a small sample project I used to test this for your refrence. For my test I am using version 13.1.20131.2069 of NetAdvantage.
Please let me know if you have any further questions regarding this issue.
Thanks, your sample worked well for me..
Please do not hesitate to contact me if you have any additional questions regarding this matter.