Syncfusion WinForms UI Controls Demos

repository·master·Indexed 42 days ago

https://github.com/syncfusion/winforms-demos

A comprehensive collection of demonstration projects for Syncfusion's WinForms UI controls. This resource provides practical references for API usage, implementation patterns, and feature exploration across various categories including Grids, Data Visualization, File Format Frameworks, Navigation, and Input Controls. Requires Visual Studio 2010 or higher.

Tokens
3.7K
Snippets
11
Records
20
Agent score
53%

What's inside Syncfusion WinForms

  1. Understand C# Language Fundamentals

    master

    C# is a modern, object-oriented, and type-safe programming language running on .NET. Key features that contribute to application robustness include:

    • Garbage Collection: Automatically reclaims memory from unreachable objects.
    • Nullable Types: Protects against variables that do not refer to allocated objects.
    • Exception Handling: Provides structured error detection and recovery.
    • LINQ (Language Integrated Query): A common pattern for querying data from various sources.
    • Asynchronous Operations: Syntax for building distributed systems.
    • Unified Type System: All types, including primitives like int and double, inherit from the single root object type.
  2. Compare Class, Struct, Interface, and Delegate types

    master

    C# provides several ways to define data structures and behaviors:

    • Class: Defines data members (fields) and function members (methods, properties). Supports single inheritance and polymorphism.
    • Struct: Similar to a class but is a value type (often avoiding heap allocation). Does not support user-specified inheritance and implicitly inherits from object.
    • Interface: Defines a contract of public members. A class or struct must implement these members. Supports multiple inheritance (a type can implement multiple interfaces).
    • Delegate: Represents a reference to a method with a specific signature. Allows methods to be treated as objects that can be assigned to variables or passed as parameters.
    • Record: (record struct or record class) Primarily used for storing values with minimal behavior, utilizing compiler-synthesized members.
  3. How to download and use Syncfusion WinForms samples

    master

    The easiest way to use these samples without Git is to download the ZIP archive.

    Important Steps:

    1. Unblock the ZIP: Before unzipping, right-click the downloaded file, select Properties, and check Unblock.
    2. Unzip the entire archive: Do not unzip individual samples. All samples depend on the SharedContent folder located in the root of the archive. Unzipping only specific folders will cause build errors due to missing references.
    3. Register License Key: To use the samples, you must register your Syncfusion license key in the SyncfusionLicense.txt file within the archive.
  4. Configure NuGet package sources for Syncfusion WinForms demos

    master

    To ensure the WinForms demo projects can resolve and restore the necessary Syncfusion dependencies, the project uses a specific NuGet.config configuration. This configuration defines multiple package sources, including standard nuget.org and specialized Syncfusion sources for WPF and Windows packages.

    When working with these demos, ensure your environment is configured to use these sources so that package restoration (enabled and automatic in this configuration) can successfully fetch the required versions (e.g., version 34.2.2).

    <packageSources>
      <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
      <add key="Syncfusion WPF Package 34.2.2" value="https://api.nuget.org/v3/index.json" />
      <add key="Syncfusion WPF Sample Package 34.2.2" value="https://api.nuget.org/v3/index.json" />
      <add key="Syncfusion Windows Package 34.2.2" value="https://api.nuget.org/v3/index.json" />
    </packageSources>
  5. Reference the categories of C# Value Types

    master

    Value types in C# are stored in-line and include the following categories:

    Value typeDetails
    Simple typesSigned/unsigned integral, unicode characters, IEEE binary floating-point, high-precision decimal, and boolean.
    Enum typesUser-defined types (enum E { ... }) with named constants and an underlying integral type.
    Struct typesUser-defined types (struct S { ... }).
    Nullable value typesExtensions of value types that allow a null value.
    Tuple value typesUser-defined types in the form (T1, T2, ...).
  6. Reference the categories of C# Reference Types

    master

    Reference types are types that refer to an object in memory. They include:

    Reference typeDetails
    Class typesThe base for all types (object), Unicode strings (string), and user-defined classes (class C { ... }).
    Interface typesUser-defined contracts (interface I { ... }).
    Array typesSingle-dimensional, multi-dimensional, or jagged arrays (e.g., int[], int[,], int[][]).
    Delegate typesType-safe references to methods (delegate int D(...)).
  7. Syncfusion WinForms Controls Catalog

    master

    The repository contains demo projects for a wide variety of WinForms controls, categorized below:

    Grids

    • DataGrid, GridControl, PivotGrid, GridGroupingControl, GridListControl

    Data Visualization

    • Chart, Diagram, Barcode, BulletGraph, Digital Gauge, Linear Gauge, Maps, PivotChart, Radial Gauge, SmithChart, Sparkline, TreeMap, SkinManager

    Data Science

    • Predictive Analytics (PMML)

    File Format Frameworks

    • Excel (XlsIO), PDF, Presentation, Word (DocIO)

    File Viewers and Editors

    • PDFViewer, Spreadsheet, SyntaxEditor, HTML Viewer

    Dialogs and Notification

    • Form (SfForm), TabbedMDI, HubTile, Image Streamer, MessageBox, MetroForm, Office2010Form, ProgressBarAdv, Splash, SplashPanel, StatusBarAdv, StatusBarAdvPanel, Tooltip, SuperToolTip
    • Ribbon, RibbonPanelMergeContainer, TabControl, Menu, Context Menu, NavigationView, MulticolumnTreeView, NavigationDrawer, RadialMenu, ScrollFrame, TabSplitter Container, Toolbar, TreeView, Wizard, XPTaskPane, GroupBar, GroupView, MDIChildForms, XPTaskbar, CommandBars

    Miscellaneous

    • Calculate, Calculator, Clock, Grouping, DigitalClock, Localization

    Buttons

    • Button (SfButton), SplitButton, ToggleButton

    Lists and Dropdown

    • ComboBox, ComboBoxAutocomplete, ListView, MultiColumnComboBox, MultiSelectionComboBox, FontListBox, ComboDropDown, FontComboBox

    Calendar

    • Calendar (SfCalendar), Schedule

    Layout

    • DockingManager, BorderLayout, CardLayout, Carousel, FlowLayout, GradientPanel, GridLayout, PopupMenu, PopupControlContainer, SplitContainerAdv, TileLayout

    Input Controls

    • Numeric TextBox, Autocomplete, CheckBoxAdv, ColorUI, ColorPickerUIAdv, ColorPicker Button, FolderBrowser, MaskedEditBox, NumericUpdownExt, RadialSlider, RadioButtonAdv, RangeSlider, Rating, TextBoxExt, BannerText, CurrencyEdit, CurrencyTextBox, DomainUpdownExt, DoubleTextBox, IntegerTextBox, PercentTextBox, DateTimeEdit
  8. Register a Syncfusion license key

    master

    To use Syncfusion controls without evaluation watermarks in a WinForms application, you must register a license key at application startup. In the demo projects, this is handled by calling SyncfusionLicenseProvider.RegisterLicense() with a valid key string. The key is typically retrieved from a local file (e.g., SyncfusionLicense.txt) located in a Common directory relative to the application execution path.

    SyncfusionLicenseProvider.RegisterLicense(your_license_key_here);
  9. Perform alignment and distribution on Diagram shapes

    master

    The Syncfusion.Diagram.WinForms.Diagram control exposes several methods to align and distribute selected shapes relative to each other. Most alignment methods require at least two shapes to be selected in the diagram1.View.SelectionList.

    Alignment Methods

    • diagram1.AlignLeft(): Aligns selected shapes to the left.
    • diagram1.AlignCenter(): Aligns selected shapes to the center.
    • diagram1.AlignRight(): Aligns selected shapes to the right.
    • diagram1.AlignTop(): Aligns selected shapes to the top.
    • diagram1.AlignMiddle(): Aligns selected shapes to the middle.
    • diagram1.AlignBottom(): Aligns selected shapes to the bottom.

    Distribution and Sizing Methods

    • diagram1.SpaceAcross(): Distributes shapes horizontally.
    • diagram1.SpaceDown(): Distributes shapes vertically.
    • diagram1.SameWidth(): Sets all selected shapes to the same width.
    • diagram1.SameHeight(): Sets all selected shapes to the same height.
    • diagram1.SameSize(): Sets all selected shapes to the same size.