Im using c# .net windows form application. i have a datagrid view. It has two columns.I need to make all the cells on the second column as to have multiple line. i.e a multiline column. I will edit something in a cell and press enter key. the cursor should reach the next line in the same cell. It should not go to the next cell. What should i do?
Share
If you set the column default style like:
you can enter multiline by pressing SHIFT-ENTER
Otherwise you could change the cell control editor overriding dataGridView or handling EditingControlShowing event (the default control is a textbox)
EDIT:
there’s almost the same question here:
DataGridView: How can I make the enter key add a new line instead of changing the current cell?