Hi, I want to know if it is possible to click in one cell, and the entire row be selected.
Thanks =D
Printable View
Hi, I want to know if it is possible to click in one cell, and the entire row be selected.
Thanks =D
The first thing you should do with a control is open the Properties window and see what properties it has. Your answer is in there.
I tried but nothing happened, but thanks anyway =D
I were searching in the forum and I found this which solved my problem =D
Thanks.
That's probably something that you should have included in your first post, e.g.That said, if you really did set SelectionMode to FullRowSelect and it didn;t work then something is broken in your project or on your system. That is the one and only way to achieve your aim and whether you write code or do it in the designer should make no difference, because doing it in the designer simply generates code anyway. I just tested it out myself to make sure, even though I already knew that was the case. Here's the designer code for a form with nothing but a DGV added and that property set:Quote:
I have already set the SelectionMode property to FullRowSelect in the Properties window but it doesn't seem to work.
Code:<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.DataGridView1 = New System.Windows.Forms.DataGridView()
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGridView1
'
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill
Me.DataGridView1.Location = New System.Drawing.Point(0, 0)
Me.DataGridView1.Name = "DataGridView1"
Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.DataGridView1.Size = New System.Drawing.Size(284, 262)
Me.DataGridView1.TabIndex = 0
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 262)
Me.Controls.Add(Me.DataGridView1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
End Class
ok =)
thanks and sorry about that =)