Link to home
Start Free TrialLog in
Avatar of Shezad Ahmed
Shezad AhmedFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Allow DataGridView Column to allow new line

Hi

I need to be able to hit the Enter key in cell which creates a new line.
At the moment it goes to the next cell.
Shift and Enter does work.

Below is my code.

Open in new window

Avatar of Shezad Ahmed
Shezad Ahmed
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.DataSource = Linq_Datatable

        DataGridView1.AllowUserToAddRows = False

        DataGridView1.AllowUserToDeleteRows = False

        DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
        Me.DataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True

        Me.DataGridView1.Rows(0).Height = Me.DataGridView1.RowTemplate.Height

        Dim column As DataGridViewColumn = DataGridView1.Columns(0)
        column.Width = 70
        column.ReadOnly = True
        column.Visible = False


        Dim column2 As DataGridViewColumn = DataGridView1.Columns(1)
        column2.Width = 170
        column2.ReadOnly = True

        Dim column3 As DataGridViewColumn = DataGridView1.Columns(2)
        column3.Width = 620





    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial