From 93c1ee2623a962c69828ce925d9ba30a088fc49e Mon Sep 17 00:00:00 2001 From: KB Bot Date: Fri, 3 Oct 2025 10:12:19 +0000 Subject: [PATCH 1/5] Added new kb article spreadprocessing-simulating-checkbox-conditional-formatting --- ...ulating-checkbox-conditional-formatting.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md diff --git a/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md new file mode 100644 index 00000000..7895db7d --- /dev/null +++ b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md @@ -0,0 +1,90 @@ +--- +title: Simulating a Checkbox with Conditional Formatting in Telerik SpreadProcessing +description: Learn how to simulate a checkbox using conditional formatting with Telerik SpreadProcessing. +type: how-to +page_title: Simulating a Checkbox Using Conditional Formatting with Telerik SpreadProcessing +meta_title: Simulating a Checkbox Using Conditional Formatting with Telerik SpreadProcessing +slug: spreadprocessing-simulating-checkbox-conditional-formatting +tags: spread, processing, conditional, formatting, check, box, telerik, document, xlsx +res_type: kb +ticketid: 1667088 +--- + +## Environment + + + + + + + + + + + + +
Product +SpreadProcessing for Telerik Document Processing +
Version 2015.1.225
+ +## Description + +This article describes how to use the SpreadProcessing library to simulate a checkbox by using conditional formatting rules. The goal is to display a checked symbol (☑) when the cell value is `1` and an unchecked symbol (☐) when the cell value is `0`. + +This knowledge base article also answers the following questions: +- How to simulate checkbox behavior in Telerik SpreadProcessing? +- How to use conditional formatting for representing checkboxes? +- How to display different symbols based on cell values in Telerik SpreadProcessing? + +## Solution + +To simulate a checkbox using conditional formatting in Telerik SpreadProcessing, apply two separate conditional formatting rules. One for the checked state and one for the unchecked state. + +1. Create a workbook and add a worksheet. +2. Define a *DifferentialFormatting* for the checked state with a format that displays "☑". +3. Create an *EqualToRule* for the checked state, matching cells with a value of *1*. +4. Apply the conditional formatting rule to the cell. +5. Define another *DifferentialFormatting* for the unchecked state with a format that displays "☐". +6. Create an *EqualToRule* for the unchecked state, matching cells with a value of *0*. +7. Apply the second conditional formatting rule to the cell. +8. Set the cell value to *1* or *0* to test the checkbox simulation. +9. Export the workbook to an XLSX file. + +Here’s an example implementation: + +```csharp +Workbook workbook = new Workbook(); +Worksheet worksheet = workbook.Worksheets.Add(); + +// Define formatting for checked state +DifferentialFormatting checkedFormatting = new DifferentialFormatting(); +checkedFormatting.CellValueFormat = new CellValueFormat("☑"); +EqualToRule checkedRule = new EqualToRule("1", checkedFormatting); +ConditionalFormatting checkedConditionalFormatting = new ConditionalFormatting(checkedRule); +worksheet.Cells[0, 0].AddConditionalFormatting(checkedConditionalFormatting); + +// Define formatting for unchecked state +DifferentialFormatting uncheckedFormatting = new DifferentialFormatting(); +uncheckedFormatting.CellValueFormat = new CellValueFormat("☐"); +EqualToRule uncheckedRule = new EqualToRule("0", uncheckedFormatting); +ConditionalFormatting uncheckedConditionalFormatting = new ConditionalFormatting(uncheckedRule); +worksheet.Cells[0, 0].AddConditionalFormatting(uncheckedConditionalFormatting); + +// Set initial value to simulate checkbox +worksheet.Cells[0, 0].SetValue(1); + +// Export workbook to XLSX file +string xlsxOutputPath = "output.xlsx"; +IWorkbookFormatProvider xlsxFormatProvider = new XlsxFormatProvider(); + +using (Stream output = new FileStream(xlsxOutputPath, FileMode.Create)) +{ + xlsxFormatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); +} +``` + +## See Also + +- [Conditional Formatting in Telerik SpreadProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/conditional-formatting#conditional-formatting) +- [Workbook Object in Telerik SpreadProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/workbooks) +- [XlsxFormatProvider Overview](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/xlsx) From 829df9a936240f06f7bb142d97eca98359c0e910 Mon Sep 17 00:00:00 2001 From: "PROGRESS\\ykaraman" Date: Fri, 3 Oct 2025 15:03:12 +0300 Subject: [PATCH 2/5] Polished KB --- ...ulating-checkbox-conditional-formatting.md | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md index 7895db7d..b91e3ec6 100644 --- a/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md +++ b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md @@ -12,24 +12,13 @@ ticketid: 1667088 ## Environment - - - - - - - - - - - -
Product -SpreadProcessing for Telerik Document Processing -
Version 2015.1.225
+|Product Version|Product|Author| +|----|----|----| +|2025.3.806|[SpreadProcessing]({%slug radspreadprocessing-overview%})|[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| ## Description -This article describes how to use the SpreadProcessing library to simulate a checkbox by using conditional formatting rules. The goal is to display a checked symbol (☑) when the cell value is `1` and an unchecked symbol (☐) when the cell value is `0`. +This article describes how to use the [SpreadProcessing]({%slug radspreadprocessing-overview%}) library to simulate a checkbox by using conditional formatting rules. The goal is to display a checked symbol (☑) when the cell value is **1** and an unchecked symbol (☐) when the cell value is **0**. This knowledge base article also answers the following questions: - How to simulate checkbox behavior in Telerik SpreadProcessing? @@ -41,13 +30,13 @@ This knowledge base article also answers the following questions: To simulate a checkbox using conditional formatting in Telerik SpreadProcessing, apply two separate conditional formatting rules. One for the checked state and one for the unchecked state. 1. Create a workbook and add a worksheet. -2. Define a *DifferentialFormatting* for the checked state with a format that displays "☑". -3. Create an *EqualToRule* for the checked state, matching cells with a value of *1*. +2. Define a **DifferentialFormatting** for the checked state with a format that displays "☑". +3. Create an **EqualToRule** for the checked state, matching cells with a value of **1**. 4. Apply the conditional formatting rule to the cell. -5. Define another *DifferentialFormatting* for the unchecked state with a format that displays "☐". -6. Create an *EqualToRule* for the unchecked state, matching cells with a value of *0*. +5. Define another **DifferentialFormatting** for the unchecked state with a format that displays "☐". +6. Create an **EqualToRule** for the unchecked state, matching cells with a value of **0**. 7. Apply the second conditional formatting rule to the cell. -8. Set the cell value to *1* or *0* to test the checkbox simulation. +8. Set the cell value to **1** or **0** to test the checkbox simulation. 9. Export the workbook to an XLSX file. Here’s an example implementation: @@ -85,6 +74,5 @@ using (Stream output = new FileStream(xlsxOutputPath, FileMode.Create)) ## See Also -- [Conditional Formatting in Telerik SpreadProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/conditional-formatting#conditional-formatting) -- [Workbook Object in Telerik SpreadProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/workbooks) -- [XlsxFormatProvider Overview](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/xlsx) +* [Conditional Formatting]{%slug radspreadprocessing-features-conditional-formatting%} +* [Workbook]{%slug radspreadprocessing-working-with-workbooks-what-is-workbook%} From b806d2ff9f0f79b1728607457c0380b520bef771 Mon Sep 17 00:00:00 2001 From: "PROGRESS\\ykaraman" Date: Fri, 3 Oct 2025 15:03:25 +0300 Subject: [PATCH 3/5] Added Second KB. --- ...-winforms-runtime-dpi-aware-application.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 knowledge-base/fix-winforms-runtime-dpi-aware-application.md diff --git a/knowledge-base/fix-winforms-runtime-dpi-aware-application.md b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md new file mode 100644 index 00000000..9b336c03 --- /dev/null +++ b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md @@ -0,0 +1,60 @@ +--- +title: Fix WinForms Runtime DPI-Aware Application +description: Fix a WinForms application that unexpectedly becomes (per‑monitor) DPI aware and changes size when using controls depending on the Telerik Document Processing libraries. +type: how-to +page_title: Fix WinForms Runtime DPI-Aware Application +slug: fix-winforms-runtime-dpi-aware-application +position: 0 +tags: winforms, dpi, scaling, document, processing, pdf, viewer, rich, text, editor, spreadsheet, control, aware, shrink, scale +res_type: kb +--- + +## Environment + +|Product Version|Product|Author| +|----|----|----| +|All|Document Processing Libraries|[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| + +## Description + +A WinForms application may appear smaller (or larger) at runtime after using [Document Processing Libraries]({%slug introduction%}) (**DPL**) functionality or [DPL-dependent Telerik controls](https://docs.telerik.com/devtools/winforms/integration-with-other-telerik-products/document-processing-libraries#telerik-ui-for-winforms-integration) (**RadPdfViewer**, **RadRichTextEditor**, **RadSpreadsheetEditor**, **RadDiagram**). This can occur, for example, when exporting data, loading a document, or instantiating types from assemblies used by: + +These dependencies internally rely on WPF assemblies where DPI awareness is enabled at the assembly level. The moment a type from such an assembly is initialized, the hosting WinForms process can become DPI-aware. + +## Solution + +You can choose between two approaches: + +### 1. Make the application explicitly DPI-aware + +With this approach your app will look smaller when started. It will not look blurry on HDPI displays. Detailed information is available in the [DPI Support](https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support) article. + +### 2. Keep (or force) the application DPI-unaware (Windows 10 only) + +This approach works only on Windows 10. If you intend to use your application on machines where the DPI scaling is larger than 100 percent, you should explicitly set the application to be DPI-unaware + +#### [C#] Force process DPI unaware before using a Document Processing type + +```csharp +private void workbookTestButton_Click(object sender, EventArgs e) +{ + SetProcessDpiAwareness(_Process_DPI_Awareness.Process_DPI_Unaware); + Workbook wb = new Workbook(); +} + +[DllImport("shcore.dll")] +static extern int SetProcessDpiAwareness(_Process_DPI_Awareness value); + +enum _Process_DPI_Awareness +{ + Process_DPI_Unaware = 0, + Process_System_DPI_Aware = 1, + Process_Per_Monitor_DPI_Aware = 2 +} +``` + +>note None of the above approaches affect the application when the scaling is set to 100%. + +## See Also + +* [DPI Support](https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support) \ No newline at end of file From cc631ef2306f86210b65e1c9bf398a4d96674d24 Mon Sep 17 00:00:00 2001 From: Desislava Yordanova Date: Mon, 6 Oct 2025 12:27:48 +0300 Subject: [PATCH 4/5] polishing --- .../fix-winforms-runtime-dpi-aware-application.md | 8 ++++---- ...sing-simulating-checkbox-conditional-formatting.md | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/knowledge-base/fix-winforms-runtime-dpi-aware-application.md b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md index 9b336c03..ba1bd449 100644 --- a/knowledge-base/fix-winforms-runtime-dpi-aware-application.md +++ b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md @@ -1,11 +1,11 @@ --- -title: Fix WinForms Runtime DPI-Aware Application +title: Resolving Unexpected Per-Monitor DPI Awareness in WinForms Apps description: Fix a WinForms application that unexpectedly becomes (per‑monitor) DPI aware and changes size when using controls depending on the Telerik Document Processing libraries. type: how-to -page_title: Fix WinForms Runtime DPI-Aware Application +page_title: Why Your WinForms App Resizes - DPI Awareness and Telerik Document Processing Explained slug: fix-winforms-runtime-dpi-aware-application position: 0 -tags: winforms, dpi, scaling, document, processing, pdf, viewer, rich, text, editor, spreadsheet, control, aware, shrink, scale +tags: winforms,windows, forms, dpi, scaling, document, processing, pdf, viewer, rich, text, editor, spreadsheet, control, aware, shrink, scale res_type: kb --- @@ -17,7 +17,7 @@ res_type: kb ## Description -A WinForms application may appear smaller (or larger) at runtime after using [Document Processing Libraries]({%slug introduction%}) (**DPL**) functionality or [DPL-dependent Telerik controls](https://docs.telerik.com/devtools/winforms/integration-with-other-telerik-products/document-processing-libraries#telerik-ui-for-winforms-integration) (**RadPdfViewer**, **RadRichTextEditor**, **RadSpreadsheetEditor**, **RadDiagram**). This can occur, for example, when exporting data, loading a document, or instantiating types from assemblies used by: +A WinForms application may appear smaller (or larger) at runtime after using [Document Processing Libraries]({%slug introduction%}) (**DPL**) functionality or [DPL-dependent Telerik controls](https://docs.telerik.com/devtools/winforms/integration-with-other-telerik-products/document-processing-libraries#telerik-ui-for-winforms-integration) (e. g. **RadPdfViewer**, **RadSpreadsheet**). This can occur, for example, when **exporting data**, loading a document, or instantiating types from assemblies used by: These dependencies internally rely on WPF assemblies where DPI awareness is enabled at the assembly level. The moment a type from such an assembly is initialized, the hosting WinForms process can become DPI-aware. diff --git a/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md index b91e3ec6..39ebc553 100644 --- a/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md +++ b/knowledge-base/spreadprocessing-simulating-checkbox-conditional-formatting.md @@ -27,10 +27,10 @@ This knowledge base article also answers the following questions: ## Solution -To simulate a checkbox using conditional formatting in Telerik SpreadProcessing, apply two separate conditional formatting rules. One for the checked state and one for the unchecked state. +To simulate a checkbox using conditional formatting in Telerik SpreadProcessing, apply two separate conditional formatting rules: one for the `checked` state and one for the `unchecked` state. -1. Create a workbook and add a worksheet. -2. Define a **DifferentialFormatting** for the checked state with a format that displays "☑". +1. Create a [Workbook]({%slug radspreadprocessing-working-with-workbooks-what-is-workbook%}) and add a worksheet. +2. Define a [DifferentialFormatting]({%slug radspreadprocessing-features-conditional-formatting%}) for the checked state with a format that displays "☑". 3. Create an **EqualToRule** for the checked state, matching cells with a value of **1**. 4. Apply the conditional formatting rule to the cell. 5. Define another **DifferentialFormatting** for the unchecked state with a format that displays "☐". @@ -74,5 +74,6 @@ using (Stream output = new FileStream(xlsxOutputPath, FileMode.Create)) ## See Also -* [Conditional Formatting]{%slug radspreadprocessing-features-conditional-formatting%} -* [Workbook]{%slug radspreadprocessing-working-with-workbooks-what-is-workbook%} +* [Conditional Formatting]({%slug radspreadprocessing-features-conditional-formatting%}) +* [Workbook]({%slug radspreadprocessing-working-with-workbooks-what-is-workbook%}) +* [Using XlsxFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider%}) From 55d36d4fab48dee232657e2e726ed9d4ffe89900 Mon Sep 17 00:00:00 2001 From: "PROGRESS\\ykaraman" Date: Mon, 6 Oct 2025 12:42:15 +0300 Subject: [PATCH 5/5] Added result checkbox image. --- .../images/conditional-formatting-checkbox.png | Bin 0 -> 2658 bytes ...simulating-checkbox-conditional-formatting.md | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 knowledge-base/images/conditional-formatting-checkbox.png diff --git a/knowledge-base/images/conditional-formatting-checkbox.png b/knowledge-base/images/conditional-formatting-checkbox.png new file mode 100644 index 0000000000000000000000000000000000000000..c16cfb4298b591eeeff4df2ca528bdc486111af6 GIT binary patch literal 2658 zcmV-o3Z3oFd-s(G2}vLtf*Oq)D@ZX&%c#@o_!v85D?X^BZLL}#9Y?AoeaLi5oodHv z|0!*q&Nx`Lj5z94kxE-@TM1%SAV>hCL?99%0rK4U^Y)yLt4o^4?q&lQdcQMwa_`=A z&z_v``906?t}-w%U~-(HX&Q$QAI9(ZQ(j(9DwV><C1ws;by14&tYA|wMj|;(aWkn*9v`xrf zWj4XZhn&-FpJvJlmW0M)F+!mb@p$|*J27$~R)*qm;x>HvbOTKh3lnQ2TX3e-$;yx$ z3iD)Gn+~^O2VQ;&&+8?Q%;!#k4J81Ao3XL z^;ru#J}pE?`)e#)wUoR5_6%!}x|yb1bIhY@#wj5|tj($dwDPVTq@L?mb&*NvL=% ztazr(i_VqY(FS5YIB_YT@S(81(O5kfU(ifdZ5g$FZ}ZajJ`Cf8<%q_`l!Zz8kSp)W zHdZEB(FK7$9c()oXJ}>0}8N ztOeQp@fO}1N;3ECFEBe2Vp?S#^K0wq?QUiBppMIeS=OT4;6li?JRAnja2M^}9~086 zX)N`yulE35ijKEpI;RhGu(7iTUAKN7eNtK`JBg8R$YbS1hoqsU}J&F4UeWk2tYpCDqf;r@6eFuH8Fm)tn-rvJOVh ztCDX;huje=gk0I)>-FOCc!YDJ)85|B;NT#Qjg4tlZxtwtgJdE^C?@o-$Ygm%xa2TD z-(XOLOqi)SkyuDrV*`)dKsT+i0U;}8y1Tmx1OhZSHxrFU^RvN|k=*QOth}3Knn_fl zrpt7p+{|Hz#msUZ#i)gu*2F?B$0yE{$z$)IXp9U$^CDQTkdl&;fn1sd z$Cw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