使用C#检查excel中的分组行 [英] Check on grouped rows in excel with c#

查看:158
本文介绍了使用C#检查excel中的分组行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像标题说的那样,我不知道如何检查已分组的行.我用Google搜索,但是找不到任何东西.

Like the title says, I don't know how to check on a row which is grouped. I Googled it, but couldn't find anything.

此代码不起作用:

if (((Excel.Range)sourceRange.Rows[i]).Group() == true)   // doesn't work
{
     ...
}

有人知道如何对行进行分组吗?

Does somebody know how to check a row if it is grouped or not?

推荐答案

您可以查询Range对象的属性OutlineLevel.如果值为1,则不进行分组.较大的值表示该区域在一个(最终嵌套的)组中.

You can query the property OutlineLevel of the Range object. If the value is 1 it is not grouped. Greater values mean that the region is in a (eventually nested) group.

这篇关于使用C#检查excel中的分组行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆