We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to jump to a cell

Thread ID:





67964 Sep 5,2007 11:47 AM Sep 7,2007 06:14 AM Windows Forms 6
Tags: GridControl
Geoff Parker
Asked On September 5, 2007 11:47 AM

I want to change the current cell to say col1 row 4, any ideas


Philip Bishop
Replied On September 5, 2007 12:11 PM

This following will change the current cell to row2, col2....

grdAGCY_AR.CurrentCell.MoveTo(2, 2)

This next piece of code will do the same as above and scoll the cell in view if it wasn't in view.....

grdExpires.CurrentCell.MoveTo(2, 2, GridSetCurrentCellOptions.ScrollInView)

Philip Bishop
Replied On September 5, 2007 12:13 PM

And where I had grdExpires for example this would be the name of your grid.

Geoff Parker
Replied On September 5, 2007 01:35 PM

Thanks I dont know why but I read that in the documents as moving cell contents from one place to another.


Geoff Parker
Replied On September 6, 2007 03:42 AM

Although the above code does work from a button it does not seem to work how I am trying to apply it.

When the user enters a value of x in column 2 I want to jump to column 5 and allow the user to type in a value in column five without clicking I have tried the below

Sub XXX() handles grid1control.currentcelleditingcomplete

curcell = grid1control.currentcell

if curcell.colindex = 2 then
if gridcontrol1(curcell.rowindex, 2) = "x"
gridcontrol1.currentcell.moveto(curcell.rowindex, 5)
End if
End If

Yhis does not move the current cell, any help welcome

Philip Bishop
Replied On September 6, 2007 11:47 AM

This worked for me

Private Sub gc1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gc1.CurrentCellChanged
If gc1.CurrentCell.Renderer.ControlText = "x" Then
gc1.CurrentCell.MoveTo(1, 5)
End If

Geoff Parker
Replied On September 7, 2007 06:14 AM

Philip Thanks I thanks work a treat


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.