diff --git a/MultiColumnComboBox/MultiColumnComboBox.sln b/MultiColumnComboBox/MultiColumnComboBox.sln new file mode 100644 index 0000000..4cd68b7 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiColumnComboBox", "MultiColumnComboBox\MultiColumnComboBox.csproj", "{ED6371FD-E162-492C-899D-3C00875A2904}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ED6371FD-E162-492C-899D-3C00875A2904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED6371FD-E162-492C-899D-3C00875A2904}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED6371FD-E162-492C-899D-3C00875A2904}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED6371FD-E162-492C-899D-3C00875A2904}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ADDC9792-F3FE-4CA3-9B23-76DA5BA03346} + EndGlobalSection +EndGlobal diff --git a/MultiColumnComboBox/MultiColumnComboBox/App.config b/MultiColumnComboBox/MultiColumnComboBox/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MultiColumnComboBox/MultiColumnComboBox/Form1.Designer.cs b/MultiColumnComboBox/MultiColumnComboBox/Form1.Designer.cs new file mode 100644 index 0000000..547e62b --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Form1.Designer.cs @@ -0,0 +1,66 @@ +namespace MultiColumnComboBox +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + Syncfusion.Windows.Forms.MetroColorTable metroColorTable1 = new Syncfusion.Windows.Forms.MetroColorTable(); + this.multiColumnComboBox1 = new Syncfusion.Windows.Forms.Tools.MultiColumnComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.multiColumnComboBox1)).BeginInit(); + this.SuspendLayout(); + // + // multiColumnComboBox1 + // + this.multiColumnComboBox1.BeforeTouchSize = new System.Drawing.Size(165, 21); + this.multiColumnComboBox1.Location = new System.Drawing.Point(279, 62); + this.multiColumnComboBox1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); + this.multiColumnComboBox1.Name = "multiColumnComboBox1"; + this.multiColumnComboBox1.ScrollMetroColorTable = metroColorTable1; + this.multiColumnComboBox1.Size = new System.Drawing.Size(165, 21); + this.multiColumnComboBox1.TabIndex = 0; + this.multiColumnComboBox1.Text = "multiColumnComboBox1"; + this.multiColumnComboBox1.DataSource = GetData(); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.multiColumnComboBox1); + this.Name = "Form1"; + this.Text = "Form1"; + ((System.ComponentModel.ISupportInitialize)(this.multiColumnComboBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Syncfusion.Windows.Forms.Tools.MultiColumnComboBox multiColumnComboBox1; + } +} + diff --git a/MultiColumnComboBox/MultiColumnComboBox/Form1.cs b/MultiColumnComboBox/MultiColumnComboBox/Form1.cs new file mode 100644 index 0000000..6903bbc --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Form1.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MultiColumnComboBox +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + this.Load += Form1_Load; + } + + #region Properties + + string text = ""; + + bool dropDownOpened = false; + + #endregion + + #region Data Settting + + DataView GetData() + { + //Create dataTable + DataTable dt = new DataTable("Table1"); + dt.Columns.Add("FirstName"); + dt.Columns.Add("LastName"); + dt.Columns.Add("occupation"); + dt.Columns.Add("place"); + + // Create a Data Set + DataSet ds = new DataSet(); + ds.Tables.Add(dt); + dt.Rows.Add(new string[] { "John", "Tina", "Doctor", "Italy" }); + dt.Rows.Add(new string[] { "Mary", "anu", "Teacher", "America" }); + dt.Rows.Add(new string[] { "asha", "roy", "Staff", "London" }); + dt.Rows.Add(new string[] { "George", "Gaskin", "Nurse", "germany" }); + dt.Rows.Add(new string[] { "sam", "jens", "Engineer", "Russia" }); + dt.Rows.Add(new string[] { "Ben", "Geo", "Developer", "India" }); + DataView view = new DataView(dt); + return view; + } + + #endregion + + #region Events + + private void Form1_Load(object sender, EventArgs e) + { + this.multiColumnComboBox1.SelectedIndexChanged += multiColumnComboBox1_SelectedIndexChanged; + this.multiColumnComboBox1.DropDown += multiColumnComboBox1_DropDown; + } + + private void multiColumnComboBox1_DropDown(object sender, System.EventArgs e) + { + this.dropDownOpened = true; + } + + private void multiColumnComboBox1_SelectedIndexChanged(object sender, System.EventArgs e) + { + if (this.dropDownOpened == true) + { + for (int i = 1; i <= this.multiColumnComboBox1.ListBox.Grid.ColCount; i++) + { + text += this.multiColumnComboBox1.ListBox.Grid[this.multiColumnComboBox1.SelectedIndex + 1, i].Text + " "; + } + this.dropDownOpened = false; + this.multiColumnComboBox1.Text = text; + } + text = ""; + } + + #endregion + } +} diff --git a/MultiColumnComboBox/MultiColumnComboBox/Form1.resx b/MultiColumnComboBox/MultiColumnComboBox/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MultiColumnComboBox/MultiColumnComboBox/MultiColumnComboBox.csproj b/MultiColumnComboBox/MultiColumnComboBox/MultiColumnComboBox.csproj new file mode 100644 index 0000000..feabf2b --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/MultiColumnComboBox.csproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {ED6371FD-E162-492C-899D-3C00875A2904} + WinExe + MultiColumnComboBox + MultiColumnComboBox + v4.6.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + True + + + ..\packages\Syncfusion.Grid.Base.17.4.0.55\lib\net46\Syncfusion.Grid.Base.dll + + + ..\packages\Syncfusion.Grid.Windows.17.4.0.55\lib\net46\Syncfusion.Grid.Windows.dll + + + ..\packages\Syncfusion.Licensing.17.4.0.55\lib\net46\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.Shared.Base.17.4.0.55\lib\net46\Syncfusion.Shared.Base.dll + + + ..\packages\Syncfusion.Shared.Windows.17.4.0.55\lib\net46\Syncfusion.Shared.Windows.dll + + + ..\packages\Syncfusion.SpellChecker.Base.17.4.0.55\lib\net46\Syncfusion.SpellChecker.Base.dll + + + ..\packages\Syncfusion.Tools.Base.17.4.0.55\lib\net46\Syncfusion.Tools.Base.dll + + + ..\packages\Syncfusion.Tools.Windows.17.4.0.55\lib\net46\Syncfusion.Tools.Windows.dll + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/MultiColumnComboBox/MultiColumnComboBox/Program.cs b/MultiColumnComboBox/MultiColumnComboBox/Program.cs new file mode 100644 index 0000000..cc8558c --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MultiColumnComboBox +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/MultiColumnComboBox/MultiColumnComboBox/Properties/AssemblyInfo.cs b/MultiColumnComboBox/MultiColumnComboBox/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7976369 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MultiColumnComboBox")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MultiColumnComboBox")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ed6371fd-e162-492c-899d-3c00875a2904")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.Designer.cs b/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.Designer.cs new file mode 100644 index 0000000..357c772 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MultiColumnComboBox.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MultiColumnComboBox.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.resx b/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.Designer.cs b/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.Designer.cs new file mode 100644 index 0000000..13f05f2 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MultiColumnComboBox.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.settings b/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/MultiColumnComboBox/MultiColumnComboBox/packages.config b/MultiColumnComboBox/MultiColumnComboBox/packages.config new file mode 100644 index 0000000..2117ffa --- /dev/null +++ b/MultiColumnComboBox/MultiColumnComboBox/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file