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

GridControl - mouse

Hi, In a Virtual Grid . I use custom renderers based on GridStatic and I handle all the keys through ProcessCmdKey of the custom control. But I can not handle the mouse from the renderer before another cell is activated. (I don''t want to use the lostfocus or current cell moving for this reason ) Is there any way to know and handle when the mouse is to activate another cell before the events? Regards Stefan

1 Reply

AD Administrator Syncfusion Team February 10, 2005 06:57 PM

The CellClick is raised before the cell is activated. The code that activates the current cell can actually be found in GridCellRendererBase: /// /// This is called from GridSelectCellsMouseController when the user clicked inside a cell. /// /// The row index. /// The column index. /// A with data about the mouse event. protected virtual void OnClick(int rowIndex, int colIndex, MouseEventArgs e) { scrolledInfo = Point.Empty; Grid.WindowScrolled += new ScrollWindowEventHandler(GridWindowScrolled); if (Grid.CurrentCell.HasCurrentCellAt(rowIndex, colIndex)) Grid.CurrentCell.ScrollInView(GridScrollCurrentCellReason.Click); else Grid.CurrentCell.MoveTo(rowIndex, colIndex, GridSetCurrentCellOptions.ScrollInView); Grid.WindowScrolled -= new ScrollWindowEventHandler(GridWindowScrolled); } This method is called after the CellClick event. So, you have the option to either handle CellClick or override OnClick in your derived renderer. Stefan >Hi, >In a Virtual Grid . >I use custom renderers based on GridStatic and I handle all the keys through ProcessCmdKey of the custom control. >But I can not handle the mouse >from the renderer before another cell >is activated. >(I don''t want to use the lostfocus or >current cell moving for this reason ) > >Is there any way to know and handle >when the mouse is to activate another >cell before the events? > >Regards >Stefan > > >

Loader.
Live Chat Icon For mobile
Up arrow icon