File tree Expand file tree Collapse file tree
FAQ/Hidden Column/.NET/Hidden Column Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <Solution >
2+ <Project Path =" Hidden Column/Hidden Column.csproj" />
3+ </Solution >
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFramework >net8.0</TargetFramework >
6+ <RootNamespace >Hidden_Column</RootNamespace >
7+ <ImplicitUsings >enable</ImplicitUsings >
8+ <Nullable >enable</Nullable >
9+ </PropertyGroup >
10+
11+ <ItemGroup >
12+ <PackageReference Include =" Syncfusion.XlsIO.Net.Core" Version =" *" />
13+ </ItemGroup >
14+
15+ <ItemGroup >
16+ <None Update =" Output\*" >
17+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
18+ </None >
19+ </ItemGroup >
20+ </Project >
Original file line number Diff line number Diff line change 1+ using Syncfusion . XlsIO ;
2+ using Syncfusion . XlsIO . Implementation ;
3+
4+ class Program
5+ {
6+ static void Main ( string [ ] args )
7+ {
8+ using ( ExcelEngine excelEngine = new ExcelEngine ( ) )
9+ {
10+ IApplication application = excelEngine . Excel ;
11+ application . DefaultVersion = ExcelVersion . Xlsx ;
12+ IWorkbook workbook = application . Workbooks . Create ( 1 ) ;
13+
14+ // Use the concrete WorksheetImpl when you need access to implementation-specific members
15+ WorksheetImpl sheet = workbook . Worksheets [ 0 ] as WorksheetImpl ;
16+
17+ // Hide column 1
18+ sheet . ShowColumn ( 1 , false ) ;
19+
20+ // Detect whether column 1 is hidden
21+ bool hidden = sheet . ColumnInformation [ 1 ] != null && sheet . ColumnInformation [ 1 ] . IsHidden ;
22+
23+ Console . WriteLine ( $ "Column 1 hidden: { hidden } ") ;
24+
25+ workbook . SaveAs ( Path . GetFullPath ( @"Output/Output.xlsx" ) ) ;
26+ }
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments