About
Pricing
Community
Teams
Start Free Trial
Log in
Shezad Ahmed
asked on
3/19/2015
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.
Select all
Open in new window
Visual Basic.NET
2
1
Last Comment
Nasir Razzaq
8/22/2022 - Mon
Shezad Ahmed
3/19/2015
ASKER
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.DataSource = Linq_Datatable
DataGridView1.AllowUserToA
ddRows = False
DataGridView1.AllowUserToD
eleteRows = False
DataGridView1.AutoSizeRows
Mode = DataGridViewAutoSizeRowsMo
de.AllCell
s
Me.DataGridView1.DefaultCe
llStyle.Wr
apMode = DataGridViewTriState.True
Me.DataGridView1.Rows(0).H
eight = Me.DataGridView1.RowTempla
te.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
Nasir Razzaq
3/25/2015
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
DataGridView1.DataSource = Linq_Datatable
DataGridView1.AllowUserToA
DataGridView1.AllowUserToD
DataGridView1.AutoSizeRows
Me.DataGridView1.DefaultCe
Me.DataGridView1.Rows(0).H
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