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.
I am using a GridControl which I load from memory. When I first create and manage the grid I try to set the default selection to a row in the grid and move the current cell to that row.
I am doing something like:
gridControl1.Selections.Clear();
gridControl1.CurrentCell.MoveTo(irow, 0);
gridControl1.Selections.Add(Syncfusion.Windows.Forms.Grid.GridRangeInfo.Row(irow));
gridControl1.ScrollCellInView(irow, 0);
(this is something of an oversimplification, but that's the gist).
Anyway, the MoveTo does not seem to be doing anything and the next time I go to use the CurrentCell.RowIndex or CurrentCell.ColumnIndex they still have values of -1.
The return result of the MoveTo call is false; the ErrorMessage property of the CurrentCell is empty. I tried adding a try/catch block and I tried adding a MoveFailed event handler but neither caught anything.
I suspect that I am simply doing something wrong but I am having trouble figuring out what. Could you perhaps give me some hints on when MoveTo will not work? Are there settings for the grid control with which it is not compatible? Will it only work after a certain point in the initialization of the grid (similar to controls that need things done on load instead of in the constructor)?
Any ideas you can throw my way would be greatly appreciated.
Thanks,
Cathy
ADAdministrator Syncfusion Team May 27, 2003 02:51 PM
Set ForceCurrentCellMoveTo = true when positioning the current cell before the grid is initially displayed.
Otherwise the grid tries to delay setting the current cell until it is shown.
Stefan