Clear all text and styles from Grid

Hello How can I clear all information from a grid. For example I need to reset the grid back to the orginal settings for color and data. I tried a number of ways, but the grid kept keeping its settings. John O

4 Replies

AD Administrator Syncfusion Team February 27, 2003 03:36 PM UTC

Try ClearCells(GridRangeInfo.Cells(row1, col1, row2, col2)) or for the whole table: ClearCells(GridRangeInfo.Table()) Stefan


RA Rajaraman February 27, 2003 03:59 PM UTC

Hi Stefan I am facing terrible problems when i use the same grid for Hierarchical way of showing data and back to normal dataset assigning (single row) i tried what you said but no use i tried grid1.model.clear(True) also Can u help me? regards Rajaraman Calsoft,INDIA > Try > > ClearCells(GridRangeInfo.Cells(row1, col1, row2, col2)) > or for the whole table: > ClearCells(GridRangeInfo.Table()) > > Stefan


AD Administrator Syncfusion Team February 27, 2003 04:30 PM UTC

I thought you were referring to the regular grid, not databound ... In the 1.5.2 version there is a Model.Binder.ResetHierarchyLevels() method that solves an issue when changing the DataSource after setting up hierarchies. You could do: grid.DataMember = ""; grid.DataSource = yourNewDataSource; // or null grid.Binder.ResetHierarchyLevels(); Stefan


RA Rajaraman February 27, 2003 04:36 PM UTC

Hi Stefan NO I am using databound with hierarchylevels Regards Rajaraman

Loader.
Up arrow icon