Filter objects while loading workbook in GridDesktop
Possible Usage Scenarios
Please use GridDesktop.LoadDataFilter property while filtering data from the workbook.
The GridLoadDataFilterOptions enumeration has the following values.
- All
- BookSettings
- CellBlank
- CellBool
- CellData
- CellError
- CellNumeric
- CellString
- CellValue
- Chart
- ConditionalFormatting
- DataValidation
- DefinedNames
- DocumentProperties
- Formula
- Hyperlinks
- MergedArea
- PivotTable
- Settings
- Shape
- SheetData
- SheetSettings
- Structure
- Style
- Table
- VBA
- XmlMap
Filter data while Loading Workbook
The following sample code illustrates how to filter drawing from the workbook. Please check the sample excel file . As you can see , all charts/shapes/images have been filtered out of the workbook.
Sample Code
// Filter all drawing objects(including Chart, Picture, OleObject and all other drawing objects) from the workbook. | |
gridDesktop1.LoadDataFilter = GridLoadDataFilterOptions.All&~GridLoadDataFilterOptions.Drawing; | |
//here is another example ,if we want to filter to show styles and values only, we can use the below code ,notice here we use | | |
// gridDesktop1.LoadDataFilter = GridLoadDataFilterOptions.CellValue | GridLoadDataFilterOptions.Style; | |
gridDesktop1.ImportExcelFile("5472489.xlsx"); | |