From 6c794539ace0da49fb8caf0702eafcc2d1764b38 Mon Sep 17 00:00:00 2001 From: Swetha Date: Fri, 10 Nov 2023 15:33:35 +0530 Subject: [PATCH 1/2] Updated Readme file --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/README.md b/README.md index 52d6677..c86ded0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,70 @@ # WPF-ComboBoxAdv-MultiSelection This repository contains the sample that how to select the items programmatically in WPF ComboBoxAdv. + +# Creating project +Below section provides detailed information to create new project in Visual Studio to display ComboBoxAdv. +# Adding control manually in XAML +In order to add ComboBoxAdv control manually in XAML, do the below steps, + +1. Add the below required assembly references to the project, + + * Syncfusion.Shared.WPF +2. Import Syncfusion WPF schema http://schemas.syncfusion.com/wpf in XAML page or Syncfusion.Windows.Tools.Controls namespace. + +3. Declare ComboBoxAdv in XAML page. +**[XAML]** + +``` + + + +``` + +# Adding control manually in C# +In order to add ComboBoxAdv control manually in C#, do the below steps, + +1. Add the below required assembly references to the project, + + * Syncfusion.Shared.WPF + +2. Import ComboBoxAdv namespace Syncfusion.Windows.Tools.Controls. + +3. Create ComboBoxAdv control instance and add it to the page. + + +**[C#]** +``` +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + ComboBoxAdv comboBoxAdv = new ComboBoxAdv(); + this.Content = comboBoxAdv; + comboBoxAdv.Height = 30; + comboBoxAdv.Width = 150; + comboBoxAdv.DefaultText = "choose Items"; + } +} +``` +# ComboBoxAdv MultiSelection + +**[XAML]** + +``` + +``` +## How to run this application? + +To run this application, you need to first clone the WPF-ComboBoxAdv-MultiSelection repository and then open it in Visual Studio 2022. Now, simply build and run your project to view the output. + +## Troubleshooting ## +### Path too long exception +If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project. + +## License + +Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. \ No newline at end of file From 6d85c7fe6c51266ded0a0b8a411774337d7902c4 Mon Sep 17 00:00:00 2001 From: Manivannan-E <92844213+Manivannan-E@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:12:12 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 133 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 90 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index c86ded0..0b38a4d 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,117 @@ -# WPF-ComboBoxAdv-MultiSelection -This repository contains the sample that how to select the items programmatically in WPF ComboBoxAdv. +# WPF ComboBoxAdv MultiSelection +This repository demonstrates how to select items programmatically in the Syncfusion WPF ComboBoxAdv control and enable multi-selection functionality. -# Creating project -Below section provides detailed information to create new project in Visual Studio to display ComboBoxAdv. -# Adding control manually in XAML -In order to add ComboBoxAdv control manually in XAML, do the below steps, +## Why Use ComboBoxAdv MultiSelection? +- Allows users to select multiple items from a dropdown list. +- Supports data binding for dynamic item updates. +- Ideal for scenarios like filtering, tagging, or multi-choice forms. -1. Add the below required assembly references to the project, +## Creating project +Follow these steps to create a new WPF project in Visual Studio and add the ComboBoxAdv control: - * Syncfusion.Shared.WPF -2. Import Syncfusion WPF schema http://schemas.syncfusion.com/wpf in XAML page or Syncfusion.Windows.Tools.Controls namespace. +### Adding Control Manually in XAML -3. Declare ComboBoxAdv in XAML page. -**[XAML]** +1. Add the required assembly reference: + - Syncfusion.Shared.WPF +2. Import the Syncfusion WPF schema: +```XAML +xmlns:syncfusion="http://schemas.syncfusion.com/wpf" ``` - - - -``` - -# Adding control manually in C# -In order to add ComboBoxAdv control manually in C#, do the below steps, - -1. Add the below required assembly references to the project, - - * Syncfusion.Shared.WPF -2. Import ComboBoxAdv namespace Syncfusion.Windows.Tools.Controls. +3. Declare the ComboBoxAdv in XAML: +```XAML + + + +``` -3. Create ComboBoxAdv control instance and add it to the page. +### Adding Control Manually in C# +1. Add the required assembly reference: + - Syncfusion.Shared.WPF -**[C#]** +2. Import the namespace: +```C# +using Syncfusion.Windows.Tools.Controls; ``` + +3. Create and configure the ComboBoxAdv instance: +```C# public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); - ComboBoxAdv comboBoxAdv = new ComboBoxAdv(); + ComboBoxAdv comboBoxAdv = new ComboBoxAdv + { + Height = 30, + Width = 150, + DefaultText = "Choose Items" + }; this.Content = comboBoxAdv; - comboBoxAdv.Height = 30; - comboBoxAdv.Width = 150; - comboBoxAdv.DefaultText = "choose Items"; } } ``` -# ComboBoxAdv MultiSelection +## ComboBoxAdv MultiSelection Example +Enable multi-selection and bind data using MVVM: **[XAML]** - -``` - +```XAML + + + + + + + ``` -## How to run this application? +**ViewModel** +```C# +public class ViewModel : INotifyPropertyChanged +{ + private ObservableCollection selectedItems; + public ObservableCollection SelectedItems + { + get => selectedItems; + set + { + selectedItems = value; + RaisePropertyChanged(nameof(SelectedItems)); + } + } -To run this application, you need to first clone the WPF-ComboBoxAdv-MultiSelection repository and then open it in Visual Studio 2022. Now, simply build and run your project to view the output. + public ObservableCollection Countries { get; set; } -## Troubleshooting ## -### Path too long exception -If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project. + public ViewModel() + { + Countries = new ObservableCollection + { + new Country() { Name = "Denmark" }, + new Country() { Name = "New Zealand" }, + new Country() { Name = "Canada" }, + new Country() { Name = "Russia" }, + new Country() { Name = "Japan" } + }; + + SelectedItems = new ObservableCollection(Countries.Take(2)); + } -## License + public event PropertyChangedEventHandler PropertyChanged; + private void RaisePropertyChanged(string propertyName) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); +} -Syncfusion has no liability for any damage or consequence that may arise by using or viewing the samples. The samples are for demonstrative purposes, and if you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage that is related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples. \ No newline at end of file +public class Country +{ + public string Name { get; set; } +} +```