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

Virtual grid - dropdown buttons aren''t always removed when current row changes

I''m using syncfusion essential grid with the following settings: gridStyleInfo1.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; This used to work fine with, but now from time to time, the combobox cells don''t get their dropdown buttons removed when the current row changes, unless I set: this.gridControl.RefreshCurrentCellBehavior = Syncfusion.Windows.Forms.Grid.GridRefreshCurrentCellBehavior.RefreshRow; which I don''t want to do as it slows down rendering. In version I could do: gridStyleInfo1.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; this.gridControl.RefreshCurrentCellBehavior = Syncfusion.Windows.Forms.Grid.GridRefreshCurrentCellBehavior.None; and all worked fine. Any ideas?

5 Replies

AD Administrator Syncfusion Team September 7, 2004 11:57 AM UTC

You can handle the CurrentCellMoved event. In your handler, call grid.RefreshRange, passing in GridRangeInfo.Cell(grid.CurrentCell.MoveFromRowIndex, grid.CurrentCell.MoveFromColIndex). This should just redraw the single cell.

SS Simon Spruzen September 9, 2004 04:55 AM UTC

Tried this - but unfortunately the last current cell wasn''t the combo box, so it never gets refreshed. My virtual grid has two columns: col 1 - a combobox col 2 - an edit control. If I click line 1 col 2, followed by line 2 col 2, the combo button in line 1 col 1 isn''t removed.

AD Administrator Syncfusion Team September 9, 2004 05:17 AM UTC

In your CurrentCellMoved handler, do not use grid.CurrentCell.MveFromColIndex to decide what cell to refresh. Instead, always refresh your combobox column (just relying on grid.CurrentCell.MoveFromRowIndex to retrieve the last row).

SS Simon Spruzen September 9, 2004 01:13 PM UTC

Ok will try. Is this a bug with

AD Administrator Syncfusion Team September 9, 2004 01:56 PM UTC has the correct behavior. Before it was refreshing the row even when the user said not to. Now it will only refresh the row when the user indicates he wants it by setting GridRefreshCurrentCellBehavior.RefreshRow. In my previous posts, I was thinking that the old row was the one not being refreshed (leaving the button displayed when it should not be). But I now realize it may be the new row that is not shwoingteh button. If that is teh case, you can do exactly what I described above, but use grid.CurrentCell.MoveToRowIndex instead of MoveFromRowIndex. So, if you want to use this ShowButtons = CurrentRow setting, then you will either have set the GridRefreshCurrentCellBehavior.RefreshRow property or handle some event like CurrentCellMoved and refresh the cell yourself.

Live Chat Icon For mobile
Up arrow icon