Home Forums WinForms controls Xceed Grid for WinForms Don’t allow row selection Reply To: Don’t allow row selection

User (Old forums)
Member
Post count: 23064

Thanks Tommy for your answer.
I set the property you wrote, but if the user click on the grid the selection is cancelled.

Here is a snippet from my Code:
In InitializeComponent:

‘GridControl1

Me.GridControl1.AllowCellNavigation = False
Me.GridControl1.DataRowTemplate = Me.dataRowTemplate1
Me.GridControl1.FixedHeaderRows.Add(Me.GroupByRow1)
Me.GridControl1.FixedHeaderRows.Add(Me.ColumnManagerRow1)
Me.GridControl1.Location = New System.Drawing.Point(88, 72)
Me.GridControl1.Name = “GridControl1”

‘GridControl1.RowSelectorPane

Me.GridControl1.RowSelectorPane.Visible = False
Me.GridControl1.SelectionMode = System.Windows.Forms.SelectionMode.None
Me.GridControl1.Size = New System.Drawing.Size(440, 176)
Me.GridControl1.TabIndex = 0

————–

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If IsNothing(m_dtTab3) Then
m_dtTab3 = New DataTable
End If
m_dtTab3.Columns.Clear()
m_dtTab3.Columns.Add(“RapPercTab2”, GetType(System.String))
m_dtTab3.Columns.Add(“RapPercTab2Min”, GetType(System.Int16))
m_dtTab3.Columns.Add(“RapPercTab2Max”, GetType(System.Int16))
m_dtTab3.Columns.Add(“PercIncr3”, GetType(System.Decimal))

Dim dr As DataRow
dr = m_dtTab3.NewRow
dr(“RapPercTab2Max”) = 50
dr(“RapPercTab2”) = “x <= ” & dr(“RapPercTab2Max”).ToString
dr(“PercIncr3”) = 0
m_dtTab3.Rows.Add(dr)
dr = m_dtTab3.NewRow
dr(“RapPercTab2Min”) = 50
dr(“RapPercTab2Max”) = 75
dr(“RapPercTab2”) = dr(“RapPercTab2Min”).ToString & ” < x <= ” & dr(“RapPercTab2Max”).ToString
dr(“PercIncr3”) = 10
m_dtTab3.Rows.Add(dr)
dr = m_dtTab3.NewRow
dr(“RapPercTab2Min”) = 75
dr(“RapPercTab2Max”) = 100
dr(“RapPercTab2”) = dr(“RapPercTab2Min”).ToString & ” < x <= ” & dr(“RapPercTab2Max”).ToString
dr(“PercIncr3”) = 20
m_dtTab3.Rows.Add(dr)
dr = m_dtTab3.NewRow
dr(“RapPercTab2Min”) = 100
dr(“RapPercTab2”) = “x > ” & dr(“RapPercTab2Min”).ToString
dr(“PercIncr3”) = 30
m_dtTab3.Rows.Add(dr)

GridControl1.DataSource = m_dtTab3
GridControl1.DataRows(2).IsSelected = True
End Sub

Imported from legacy forums. Posted by Gian Luigi (had 431 views)