The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
ADAdministrator Syncfusion Team June 23, 2006 08:11 PM UTC
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
MSMaxim Software SystemsJune 23, 2006 08:42 PM UTC
> 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?
MSMaxim Software SystemsJune 26, 2006 01:30 PM UTC
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.