Home Forums WinForms controls Xceed Grid for WinForms the cell event ? Reply To: the cell event ?

User (Old forums)
Member
Post count: 23064

thank a lot ! I appreciate your favor

but i try later ..

1.
GridControl1.BeginInit()
GridControl1.DataSource = db.Tables(0)
Dim i As Integer
For i = 2 To GridControl1.DataRowTemplate.Cells.Count – 1
AddHandler GridControl1.DataRowTemplate.Cells(i).Click, AddressOf Me.cell_Click
Next
GridControl1.EndInit()

***** AddHandler GridControl1.DataRowTemplate.Cells(i).<the event can be happen by user put som buttons on keyboard ??> , AddressOf Me.cell_Click *******

2.
<code>// before update :

‘==== find the position===== GridControl1 is Xeed.GridControl
Dim rowIndex, columnIndex As Integer
rowIndex = Me.GridControl1.DataRows.IndexOf(Me.GridControl1.CurrentRow)
columnIndex = Me.GridControl1.Columns.IndexOf(Me.GridControl1.CurrentColumn)

‘example: i get the rowIndex = 2 and columnIndex = 50

GridControl1.Refresh()
Call Query() ‘load the data and display the data on Xceed.GridControl1

Me.GridControl1.CurrentRow = Me.GridControl1.DataRows(rowIndex)
Me.GridControl1.CurrentColumn = Me.GridControl1.Columns(columnIndex)
Me.GridControl1.Select()

run later ====> the selected row which color be change still is first row

Imported from legacy forums. Posted by michaelcao (had 452 views)