We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Select a cell or row using GridDesktop

Hello,

I am using the latest version 2.2.0.2000 of GridDesktop and I want to be able to select or setfocus to a whole row. I also want to be able to select or set focus to a single cell using the code.

Can this be done and if so what would the code be?

Thanks in advance.

Phil

Hi,

Please try the following code to set focus on a cell.

'To set focus to a cell i.e. A10
Dim sheet As Aspose.Cells.GridDesktop.Worksheet = Me.GridDesktop1.GetActiveWorksheet()
sheet.SetFocusedCell(9, 0)


Thank you.

Hi,

And, please see the following sample code how to copy a whole
row data to other row in the grid.

Dim sheet As Worksheet
= GridDesktop1.Worksheets(0)
Dim range As CellRange = New
CellRange(2, 0, 2, sheet.ColumnsCount - 1)

sheet.ClearSelection()
sheet.AddSelectedRange(range)


sheet.Cells(2, 3).Value = “23”
GridDesktop1.Copy()

sheet.SetFocusedCell(4, 0)
GridDesktop1.Paste()


Thank
you.