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

CellCommentTips in Virtual Grid

Using the CellCommentTips example, I am trying to create my own MouseController. However I am attaching this controller to a virtual grid. Everything works well, with one exception. The controller I implemented pops up a supporting window (Just like the CellCommentTips example.), within MouseHover. The problem appears to be that GridQueryInfo is being called as the new window appears, which causes MouseLeave to be fired, but my mouse hasn''t left so MouseHover gets called.... Needless to say, I get a flashing window. I thought perhaps I was missing something from the example so I wired up the example to a virtual grid and got the same behavior. Do you have any suggestions for mitigating this behavior? thanks! -dan

8 Replies

AD Administrator Syncfusion Team March 1, 2004 08:23 PM UTC

Are you saving the tip in SaveCellInfo, and retrieving it in QueryCcellInfo? Here is a sample that does tips for a GridDataBoundGrid. A GridDataBoundGrid is a type of virtual grid. This sample saves the Excel Tips in a hashtable in SaveCellInfo, and retrieves them from the hashtable in QueryCellInfo. It does not seem to have a flashing problem. ExcelCommentGDBG_2238.zip


DL Dongxian Li November 22, 2004 06:56 PM UTC

Hi Clay, I used the cellCommentTips in my virtual grid. It works fine when the scrollbar is at the leftmost position. But there is a problem when the scrollbar is moved and is not at the beginning position. The comment window becomes invisible or not at the side of the right click cell even if it is visible. How should I fix the problem? Thanks Dongxian


AD Administrator Syncfusion Team November 22, 2004 10:23 PM UTC

The positioning/size calculations are done in GridCellComment.InitializeComment. At the bottom of that method, you can test to see if the panel will be off the display, and if so then move it. Here is the sample modified to do this. The changes included adding the grid to the call list for the InitializeComment method so you could use its clientwidth. Also, a property was added to indicate whether the panel was moved so the mouse controller knows not to draw the little arrow. I am not sure what you want to do about drawing the arrow. I just did not draw it in this case. You could draw it in some other position if you want.


DL Dongxian Li November 29, 2004 06:58 PM UTC

Hi Clay, Thanks for the reply. Your sample solved part of the problem. It works when the virtual grid does not have frozen rows and frozen cols. It does not work when the virtual grid control has frozen rows and frozen cols. The cell comment viewing window flashes and the cell comment edit window does not positioned in the right place. But I have figured out a way to fix the problem. I have made changes to the GridCellComment.InitializeComment, CommentMouseController.StartEditing and CommentMouseController.MouseHover to make it work. I have attached the modified zip file for your info. I am using .Net Framework 1.1, so the solutions are 1.1 format. Thanks again for your excellent support. Dongxian CS_CellComment_GridWithFrozenRows_4490.zip


DL Dongxian Li February 9, 2005 10:23 PM UTC

I am using the cell comment in a virtual grid. The cell comment works fine when the virtual grid is not in split mode. But it does not work when the grid is splitted into four. The cell comment only appears on the top-left corner grid, it does not appear on the other grids. Is there a way to make it work on all the grids? Thanks Dongxian


AD Administrator Syncfusion Team February 9, 2005 10:59 PM UTC

Dongxian, make sure you handle then PaneCreated and PaneCloseing event. In PaneCreated you need to instantiate the MouseController for the new pane. In PaneCloseing you need to dispose it. Stefan >I am using the cell comment in a virtual grid. The cell comment works fine when the virtual grid is not in split mode. But it does not work when the grid is splitted into four. The cell comment only appears on the top-left corner grid, it does not appear on the other grids. Is there a way to make it work on all the grids? > >Thanks >Dongxian > >


DL Dongxian Li February 9, 2005 11:40 PM UTC

I tried that and it still does not work. I added following code to PaneCreated and PaneClosing: private void splitterControl1_PaneCreated(object sender, Syncfusion.Windows.Forms.SplitterPaneEventArgs e) { GridControl grid = e.Control as GridControl; ExcelTip.CommentMouseController commentMouseController; commentMouseController = new ExcelTip.CommentMouseController(gridControl1); commentMouseController.ContextMenuEnabled = true; grid.MouseControllerDispatcher.Add(commentMouseController1); } private void splitterControl1_PaneClosing(object sender, Syncfusion.Windows.Forms.SplitterPaneEventArgs e) { GridControl grid = e.Control as GridControl; grid.MouseControllerDispatcher.Dispose(); } Attached is the zipped Form1.cs file that contains the code. Thanks dongxian Form1_3978.zip


DL Dongxian Li February 9, 2005 11:44 PM UTC

Sorry. I made a mistake in the code. I passed the wrong gridControl to mouseController. After I corrected the problem. It works fine. Thanks for the help. I appreciate it. -Dongxian >I tried that and it still does not work. I added following code to PaneCreated and PaneClosing: > >private void splitterControl1_PaneCreated(object sender, > Syncfusion.Windows.Forms.SplitterPaneEventArgs e) >{ > GridControl grid = e.Control as GridControl; > ExcelTip.CommentMouseController commentMouseController; > commentMouseController = new ExcelTip.CommentMouseController(gridControl1); > commentMouseController.ContextMenuEnabled = true; > grid.MouseControllerDispatcher.Add(commentMouseController1); > >} > >private void splitterControl1_PaneClosing(object sender, > Syncfusion.Windows.Forms.SplitterPaneEventArgs e) >{ > GridControl grid = e.Control as GridControl; > grid.MouseControllerDispatcher.Dispose(); > >} > > >Attached is the zipped Form1.cs file that contains the code. > >Thanks >dongxian > > > >Form1_3978.zip > >

Loader.
Live Chat Icon For mobile
Up arrow icon