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 set CurrentCell to -1, -1

Thread ID:

Created:

Updated:

Platform:

Replies:

45583 Jun 23,2006 03:26 PM Jun 26,2006 09:30 AM Windows Forms 3
loading
Tags: GridControl
Maxim Software Systems
Asked On June 23, 2006 03:26 PM

Is it possible to return the state of the CurrentCell in a GridControl back to what it was before any cell was actually selected. I''ve tried moving the CurrentCell to -1, -1, but that doesn''t work.

Administrator [Syncfusion]
Replied On June 23, 2006 04:11 PM

Hi Don, Regarding the previous selected cell movement: Try this code to retrun back to the previously selected cell in a grid. Here is a code snippet. int prevRowIndex = -1; int prevColIndex = -1; private void gridControl1_CurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellMovingEventArgs e) { prevColIndex = this.gridControl1.CurrentCell.ColIndex; prevRowIndex = this.gridControl1.CurrentCell.RowIndex; } private void button2_Click(object sender, System.EventArgs e) { this.gridControl1.CurrentCell.MoveTo(prevRowIndex,prevColIndex); } Regarding the cell(-1,-1): You need to call the CurrentCell. MoveTo method to move the current cell to required position(-1,-1). this.gridControl1.CurrentCell.MoveTo(-1,-1); Here is a sample. http://www.syncfusion.com/Support/user/uploads/GridControlCurrentCell_f52c60e7.zip Let me know if this helps. Best Regards, Haneef

Maxim Software Systems
Replied On June 23, 2006 04:42 PM

> Regarding the previous selected cell movement I meant the "-1,-1" cell that was selected before the user actually selects a cell in grid, but thanks for the info. >Regarding the cell(-1,-1): > >You need to call the CurrentCell. MoveTo method >to move the current cell to required >position(-1,-1). > >this.gridControl1.CurrentCell.MoveTo(-1,-1); Yes, this is what I tried to do and it didn''t work. I tried putting this exact code in a test button on my form and it had no effect. Putting a watch on the CurrentCell I saw that the rowindex and colindex properties didn''t change. Am I missing something?

Maxim Software Systems
Replied On June 26, 2006 09:30 AM

The closest I seem to be able to get to doing what I want is calling: mygrid.CurrentCell.SetPositionNoActivate(-1, -1) Unfortunately, it still looks like the previously selected cell is still active when I do this.

CONFIRMATION

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.

;