CurrentCell.Renderer.Control.Refresh vs CurrentCell.Refresh

CurrentCell.Renderer.Control.Refresh vs CurrentCell.Refresh May I know what are the differences between them? Thank you.

1 Reply

AD Administrator Syncfusion Team July 13, 2006 09:38 AM UTC

CurrentCell.Renderer.Control.Refresh is a method from the .NET Windows Forms Control class. It simply invalidates the client area and forces the control to redraw itself and it child controls. CurrentCell.Refresh is a method in our grid code. It refreshes the current cell and forces it to repaint. If the current cell is not modified, this method will deactivate and reactivate current cell. So, it does things like get the particular renderer that is determined by the style.CellType for the current cell and makes sure that is the renderer that is being used in the currentcell. You would want to use this method to make sure the currentcell is properly displayed(using the proper renderer) if you do something in your code that might dynamically change how the current cell should behave (like changing a TextBox celltype to a Static celltype). Here is the source code for this method. public void Refresh() { if (IsChanging || this.IsLocked) return; Trace.Indent(); try { if (Renderer != null && !(this.inActivate || this.inDeactivate)) { GridStyleInfo style = Grid.GetViewStyleInfo(rowIndex, colIndex); GridCellRendererBase newRenderer = Grid.CellRenderers[style.CellType]; if (newRenderer != cellRenderer) { Reactivate(); return; } Renderer.Hide(); if (!IsModified) Renderer.Initialize(rowIndex, colIndex); } if (rowIndex >=0 && colIndex >= 0) Grid.InvalidateRange(GridRangeInfo.Cell(rowIndex, colIndex), GridRangeOptions.MergeAllSpannedCells); } finally { Trace.Unindent(); } }

Loader.
Up arrow icon