I am trying to force my grid to only allow the user to select a single row at a time. Which seems fairly straightforward, but I can't seem to find the right cocktail of properties to completely accomplish this.
I'm using Infragistics v3 2008 and I have the following code happening with a clean UltraGrid straight out of the toolbox.
The problem is when I click on a row, hold down the mouse button and drag it upwards or down. I now have two rows selected, but I only want one.
How can I force this grid to only allow a single selected row on screen?
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim odt As New DataTable("Table")
odt.Columns.Add(New DataColumn("Col1", GetType(String)))
odt.Columns.Add(New DataColumn("Col2", GetType(String)))
odt.Columns.Add(New DataColumn("Col3", GetType(String)))
odt.Rows.Add("Happy", "Joy", "Joy")
ug.DataSource = odt
End Sub
Private Sub ug_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ug.InitializeLayout
ug.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect
ug.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Single
End Class
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
And that would be it, thanks very much guys.