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

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 10:36 AM

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


RA Rajaraman February 27, 2003 10:59 AM

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 11:30 AM

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 11:36 AM

Hi Stefan NO I am using databound with hierarchylevels Regards Rajaraman

Loader.
Live Chat Icon For mobile
Up arrow icon