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. Image for the cookie policy date

CurrentCell.MoveTo issue

I have a dual virtual grid scenario in which there is a heirarchical relationship between the top grid and the bottom grid. The simple action I want to accomplish is to select the (1,1) cell position (assumming row and column header counts of 1) on form load programmatically so that any and all subsequent events get fired and the grid shows the Black focus rectangle on that cell. I perform a CurrentCell.MoveTo(1,1, GridSetCurrentCellOptions.SetFocus), and indeed i get my events to fire and the bottom grid is populated with the child records belonging to the "selected" parent record in the top grid. HOWEVER, there is no focus indicator on the cell i just moved to. I have tried using all manners of combinations of GridSetCurrentCellOptions, grid focusing, grid.ForceCurrentCellMoveTo, etc... Two interesting observations: 1) If I do a MoveTo(1,0) - I do get the dotted focus rectangle in the column header with the row highlighted 2) If I do a CurrentCell.MoveDown(1,false) and then a CurrentCell.MoveRight(1,false), I indeed get the black focus rectangle in the cell I want (but of couse I see all the movement of the cells). Any help you can provide is appreciated. I am using version 2.1.0.9 of the grid.

4 Replies

AD Administrator Syncfusion Team June 29, 2005 06:03 PM UTC

Try these calls in Form.Load; this.ActiveControl = grid; this.gridControl1.ForceCurrentCellMoveTo = true; this.gridControl1.MoveTo(1,1); this.gridControl1.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.AlwaysVisible; The last line should always show a currentcell. You may not want this.


AD Administrator Syncfusion Team June 29, 2005 07:49 PM UTC

Clay, Thanks for your quick response - it''s very much appreciated. However, your solution did not work. Some things to note: 1) I did not find a MoveTo method directly on the grid as your sample suggested so I continued to use the CurrentCell.MoveTo method 2) For what it''s worth, I don''t do the moving cell code in form load. We use asynchronous data calls so its put elsewhere, but I dont'' think that should matter. 3)I''d love to send a sample, or even create a new application that duplicates what I''m doing, but the environment I work in is so complicated that it could take days to send you a meaningful sample. 4) Even after setting ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.AlwaysVisible, I see no cell border anywhere. As I previously stated, If I MoveTo(1,0), i do get the dotted rectangle on the header row with you code in place. Any other suggestions?


AD Administrator Syncfusion Team June 29, 2005 07:54 PM UTC

You cannot reproduce the problem in a simple sample? If your movedown, moveleft that you described above works for your, then you can call grid.BeginUpdate(); //movedown moveleft... grid.EndUpdate(); grid.Refresh();


AD Administrator Syncfusion Team June 30, 2005 04:12 PM UTC

Clay, Thanks again for your quick reply and suggestions. Just thought I''d follow up. As it turns out, for some reason I had it stuck in my mind that CurrentCell.MoveTo was a purely visual concept - one that would only affect Visbile columns. I had one hidden column after the Column header and performing a MoveTo(1,1) was moving the CurrentCell to that hidden column, but obviously, since it was hidden, I was not getting a black rectangle.

Loader.
Live Chat Icon For mobile
Up arrow icon