简体   繁体   English

如何识别设置了过滤器的单元格/列?

[英]How to identify which cell(s)/column(s) have Filters set?

I am using Microsoft Interop to read the data. 我正在使用Microsoft Interop读取数据。

In excel-sheet, multiple random columns have "filters" set. 在excel工作表中,多个随机列设置了“过滤器”。 How do I find out which cells /columns have filters set? 我如何找出设置了过滤器的单元格/列? I would like lo load only the columns that have filters set. 我想只加载设置了过滤条件的列。

here is how the sheet looks like 这是床单的样子

row 1-5, col 1-10 [long text describes the data in the sheet, i do not want to load ] 第1-5行,列1-10 [长文本描述了工作表中的数据,我不想加载]

row 1-10, col 1 [some data, not filtered, i do not want to load] 第1-10行,第1列[某些数据,未过滤,我不想加载]

row 1-10, col 2-15 [filter set for some columns only, i would like to detect the filters and load the entire column data ] 第1-10行,第2-15行[仅针对某些列设置过滤器,我想检测过​​滤器并加载整个列数据]

  • The Worksheet interface has an AutoFilter property that returns an AutoFilter interface. Worksheet接口具有一个AutoFilter属性,该属性返回一个AutoFilter接口。
  • The AutoFilter interface has a Filters property that returns a Filters interface. AutoFilter接口具有一个Filters属性,该属性返回一个Filters接口。
  • The AutoFilter interface has a Range property that returns the range being filtered. AutoFilter接口具有Range属性,该属性返回要过滤的范围。
  • The Filters interface is a collection of Filter s; Filters接口是Filter的集合; these are in the same order as the columns in AutoFilter.Range 这些顺序与AutoFilter.Range的列的顺序相同
  • The Filter interface has an On property that indicates whether the column is being filtered. Filter接口具有On属性,该属性指示是否正在过滤列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在智能表中获取单元格的列类型 - How to get cell's column type in smartsheet 右键单击列标题来标识列 - Identify a column on right clicking on the column's header 如何以编程方式设置RadGridView的列的值 - How to set value of RadGridView's column programmatically 如何将按钮添加到任何datagridview列的最后一个单元格 - How to add button to any datagridview column's last cell 使用过滤器时,如果您有想要返回的内容,是否应该始终将上下文的结果设置为 ContentResult object? - When working with filters, should you set the context's result always to ContentResult object if you have something you wish to return? 如何根据单元格的值在运行时设置DataGridViewColumn数据类型? - How to set DataGridViewColumn data Type at RunTime based on the cell's value? 如何使用ExcelPackage lib将单元格的dataType设置为Number? - How to set cell's dataType to Number using ExcelPackage lib? 如何在C#中将Excel单元格的值类型设置为Text? - How to set a Excel cell's value type to Text in C#? 如何根据单元格中的可变值设置datagrid行的背景 - How to set datagrid row's background based on variably value in cell 如何让网格视图知道哪个单元格处于活动状态并将单元格的值传递给函数? - How can i ask grid view to know which cell is active and pass cell's value to my function?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM