diff --git a/RatingColumn/Employee.cs b/RatingColumn/Employee.cs
new file mode 100644
index 0000000..0001e5a
--- /dev/null
+++ b/RatingColumn/Employee.cs
@@ -0,0 +1,249 @@
+#region Copyright Syncfusion Inc. 2001-2018.
+// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
+// Use of this code is subject to the terms of our license.
+// A copy of the current license can be obtained at any time by e-mailing
+// licensing@syncfusion.com. Any infringement will be prosecuted under
+// applicable laws.
+#endregion
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+
+namespace GettingStarted
+{
+ public class Employee : INotifyPropertyChanged
+ {
+ #region Private members
+
+ private bool _selected;
+ private string _name;
+ private string _designation;
+ private string _mail;
+ private string _trust;
+ private string _status;
+ private int _proficiency;
+ private int _rating;
+ private int _salary;
+ private string _address;
+ private string _gender;
+
+
+ #endregion
+
+ public Employee(bool selected, string name, string designation, string mail, string location, string trust, int rating, string status, int proficiency, int salary, string address, string gender)
+ {
+ Selected = selected;
+ EmployeeName = name;
+ Designation = designation;
+ Mail = mail;
+ Location = location;
+ Trustworthiness = trust;
+ Rating = rating;
+ Status = status;
+ SoftwareProficiency = proficiency;
+ Salary = salary;
+ Address = address;
+ Gender = gender;
+ }
+
+ public bool Selected
+ {
+ get
+ {
+ return _selected;
+ }
+ set
+ {
+ _selected = value;
+ RaisePropertyChanged("Selected");
+ }
+ }
+ ///
+ /// Gets or sets the employee name.
+ ///
+ [Display(Name = "Employee Name ")]
+ public string EmployeeName
+ {
+ get
+ {
+ return _name;
+ }
+ set
+ {
+ _name = value;
+ RaisePropertyChanged("EmployeeName");
+ }
+ }
+
+ ///
+ /// Gets or sets the designation.
+ ///
+ [Display(Name = "Designation ")]
+ public string Designation
+ {
+ get
+ {
+ return _designation;
+ }
+ set
+ {
+ _designation = value;
+ RaisePropertyChanged("Designation");
+ }
+ }
+
+ ///
+ /// Gets or sets the mail ID.
+ ///
+ [Display(Name = "Mail")]
+ public string Mail
+ {
+ get
+ {
+ return _mail;
+ }
+ set
+ {
+ _mail = value;
+ RaisePropertyChanged("Mail");
+ }
+ }
+
+ ///
+ /// Gets or sets the location.
+ ///
+ [Display(Name = "Location")]
+ public string Location { get; set; }
+
+ ///
+ /// Gets or sets the Trustworthiness.
+ ///
+ [Display(Name = "Trustworthiness")]
+ public string Trustworthiness
+ {
+ get
+ {
+ return _trust;
+ }
+ set
+ {
+ _trust = value;
+ RaisePropertyChanged("Trustworthiness");
+ }
+ }
+
+ ///
+ /// Gets or sets the rating.
+ ///
+ [Display(Name = "Rating")]
+ public int Rating
+ {
+ get
+ {
+ return _rating;
+ }
+ set
+ {
+ _rating = value;
+ RaisePropertyChanged("Rating");
+ }
+ }
+
+ ///
+ /// Gets or sets the status.
+ ///
+ [Display(Name = "Status")]
+ public string Status
+ {
+ get
+ {
+ return _status;
+ }
+ set
+ {
+ _status = value;
+ RaisePropertyChanged("Status");
+ }
+ }
+
+ ///
+ /// Gets or sets the software proficiency .
+ ///
+ [Display(Name = "Software Proficiency")]
+ public int SoftwareProficiency
+ {
+ get
+ {
+ return _proficiency;
+ }
+ set
+ {
+ _proficiency = value;
+ RaisePropertyChanged("SoftwareProficiency");
+ }
+ }
+
+ ///
+ /// Gets or sets the salary.
+ ///
+ [Display(Name = "Salary")]
+ public int Salary
+ {
+ get
+ {
+ return _salary;
+ }
+ set
+ {
+ _salary = value;
+ RaisePropertyChanged("Salary");
+ }
+ }
+
+ ///
+ /// Gets or sets the address.
+ ///
+ [Display(Name = "Address")]
+ public string Address
+ {
+ get
+ {
+ return _address;
+ }
+ set
+ {
+ _address = value;
+ RaisePropertyChanged("Address");
+ }
+ }
+
+ ///
+ /// Gets or sets the Gender.
+ ///
+ [Display(Name = "Gender")]
+ public string Gender
+ {
+ get
+ {
+ return _gender;
+ }
+ set
+ {
+ _gender = value;
+ RaisePropertyChanged("Gender");
+ }
+ }
+
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public void RaisePropertyChanged(string propertyName)
+ {
+ if (this.PropertyChanged != null)
+ this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
\ No newline at end of file
diff --git a/RatingColumn/EmployeeCollection.cs b/RatingColumn/EmployeeCollection.cs
new file mode 100644
index 0000000..39819d9
--- /dev/null
+++ b/RatingColumn/EmployeeCollection.cs
@@ -0,0 +1,89 @@
+#region Copyright Syncfusion Inc. 2001-2018.
+// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
+// Use of this code is subject to the terms of our license.
+// A copy of the current license can be obtained at any time by e-mailing
+// licensing@syncfusion.com. Any infringement will be prosecuted under
+// applicable laws.
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+
+namespace GettingStarted
+{
+ public class EmployeeCollection
+ {
+ public EmployeeCollection()
+ {
+ EmployeeDetails = new EmployeeRepository().GetEmployeeDetails(100);
+ }
+
+ private ObservableCollection _EmployeeDetails;
+
+ ///
+ /// Gets or sets the orders details.
+ ///
+ /// The orders details.
+ public ObservableCollection EmployeeDetails
+ {
+ get { return _EmployeeDetails; }
+ set { _EmployeeDetails = value; }
+ }
+ }
+
+ public class EmployeeRepository
+ {
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public EmployeeRepository()
+ {
+ }
+
+ ///
+ /// Gets the Employee details.
+ ///
+ /// The count.
+ ///
+ public ObservableCollection GetEmployeeDetails(int count)
+ {
+ string[] employees = { "Michael", "Kathryn", "Tamer", "Martin", "Davolio", "Nancy", "Fuller", "Leverling", "Therasa",
+ "Margaret", "Buchanan", "Janet", "Andrew", "Callahan", "Laura", "Dodsworth", "Anne",
+ "Bergs", "Vinet", "Anto", "Fleet", "Zachery", "Van", "Edward", "Jack", "Rose"};
+ string[] genders = { "1", "2", "1", "1", "2", "2", "1", "2", "2", "2", "1", "2", "1", "1", "2", "1", "2", "1", "1", "1", "1", "1", "1", "1", "1", "2" };
+
+ string[] designation = { "Manager", "CFO", "Designer", "Developer", "Program Directory", "System Analyst", "Project Lead" };
+
+ string[] mail = { "gmail.com", "yahoo.com", "hotmail.com" };
+ string[] trust = { "Sufficient", "Perfect", "Insufficient" };
+ string[] status = { "Active", "Inactive" };
+ string[] location = { "UK", "USA", "Sweden", "France", "Canada", "Argentina", "Austria", "Germany", "Mexico" };
+
+ string[] address = { "59 rue de lAbbaye", "Luisenstr. 48"," Rua do Paço 67", "2 rue du Commerce", "Boulevard Tirou 255",
+ "Rua do mailPaço 67", "Hauptstr. 31", "Starenweg 5", "Rua do Mercado, 12",
+ "Carrera 22 con Ave."," Carlos Soublette #8-35", "Kirchgasse 6",
+ "Sierras de Granada 9993", "Mehrheimerstr. 369", "Rua da Panificadora 12", "2817 Milton Dr.", "Kirchgasse 6",
+ "Åkergatan 24", "24, place Kléber", "Torikatu 38", "Berliner Platz 43", "5ª Ave. Los Palos Grandes", "1029 - 12th Ave. S.",
+ "Torikatu 38", "P.O. Box 555", "2817 Milton Dr.", "Taucherstraße 10", "59 rue de lAbbaye", "Via Ludovico il Moro 22",
+ "Avda. Azteca 123", "Heerstr. 22", "Berguvsvägen 8", "Magazinweg 7", "Berguvsvägen 8", "Gran Vía, 1", "Gran Vía, 1",
+ "Carrera 52 con Ave. Bolívar #65-98 Llano Largo", "Magazinweg 7", "Taucherstraße 10", "Taucherstraße 10"};
+
+
+ Random random = new Random();
+ ObservableCollection ordersDetails = new ObservableCollection();
+
+ for (int i = 10000; i < count + 10000; i++)
+ {
+ var name = employees[random.Next(25)];
+ int index = Array.IndexOf(employees, name);
+ string gender = genders[index];
+ ordersDetails.Add(new Employee(i % 2 == -1, name, designation[random.Next(6)], name.ToLower() + "@" + mail[random.Next(3)], location[random.Next(8)], trust[random.Next(3)],random.Next(1,5), status[random.Next(2)], random.Next(1, 100), random.Next(100000, 400000), address[random.Next(1, 25)], gender));
+ }
+
+ return ordersDetails;
+ }
+ }
+}
diff --git a/RatingColumn/Form1.Designer.cs b/RatingColumn/Form1.Designer.cs
new file mode 100644
index 0000000..a9dd3df
--- /dev/null
+++ b/RatingColumn/Form1.Designer.cs
@@ -0,0 +1,87 @@
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Enums;
+using Syncfusion.WinForms.Input.Enums;
+using System.Drawing;
+using System.Globalization;
+using System.Windows.Forms;
+
+namespace GettingStarted
+{
+ ///
+ /// Summary description for Form1.
+ ///
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container 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()
+ {
+ this.sfDataGrid = new Syncfusion.WinForms.DataGrid.SfDataGrid();
+ ((System.ComponentModel.ISupportInitialize)(this.sfDataGrid)).BeginInit();
+ this.SuspendLayout();
+ //
+ // sfDataGrid
+ //
+ this.sfDataGrid.AccessibleName = "Table";
+ this.sfDataGrid.AllowDraggingColumns = true;
+ this.sfDataGrid.AllowFiltering = true;
+ this.sfDataGrid.AllowResizingColumns = true;
+ this.sfDataGrid.AllowResizingHiddenColumns = true;
+ this.sfDataGrid.AutoGenerateColumns = false;
+ this.sfDataGrid.AutoSizeColumnsMode = Syncfusion.WinForms.DataGrid.Enums.AutoSizeColumnsMode.AllCells;
+ this.sfDataGrid.BackColor = System.Drawing.SystemColors.Window;
+ this.sfDataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.sfDataGrid.Location = new System.Drawing.Point(0, 0);
+ this.sfDataGrid.Name = "sfDataGrid";
+ this.sfDataGrid.RowHeight = 21;
+ this.sfDataGrid.ShowGroupDropArea = false;
+ this.sfDataGrid.Size = new System.Drawing.Size(990, 554);
+ this.sfDataGrid.TabIndex = 1;
+ //
+ // Form1
+ //
+ this.BackColor = System.Drawing.SystemColors.Window;
+ this.ClientSize = new System.Drawing.Size(990, 554);
+ this.Controls.Add(this.sfDataGrid);
+ this.Margin = new System.Windows.Forms.Padding(5);
+ this.MaximumSize = new System.Drawing.Size(1006, 593);
+ this.MinimumSize = new System.Drawing.Size(1006, 593);
+ this.Name = "Form1";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Getting Started";
+ ((System.ComponentModel.ISupportInitialize)(this.sfDataGrid)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ #region API Definition
+ private SfDataGrid sfDataGrid;
+
+ #endregion
+ }
+}
+
diff --git a/RatingColumn/Form1.cs b/RatingColumn/Form1.cs
new file mode 100644
index 0000000..5e21fc5
--- /dev/null
+++ b/RatingColumn/Form1.cs
@@ -0,0 +1,114 @@
+#region Copyright Syncfusion Inc. 2001-2018.
+// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
+// Use of this code is subject to the terms of our license.
+// A copy of the current license can be obtained at any time by e-mailing
+// licensing@syncfusion.com. Any infringement will be prosecuted under
+// applicable laws.
+#endregion
+using Syncfusion.WinForms.Controls;
+using Syncfusion.WinForms.DataGrid.Styles;
+using System.Windows.Forms;
+using Syncfusion.WinForms.DataGrid.Enums;
+using System.Collections.ObjectModel;
+using System;
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Events;
+using System.Drawing;
+using System.Globalization;
+using Syncfusion.WinForms.Input.Enums;
+
+namespace GettingStarted
+{
+ public partial class Form1 : Form
+ {
+ #region Constructor
+ public Form1()
+ {
+ InitializeComponent();
+
+ // Register the custom cell renderer.
+ this.sfDataGrid.CellRenderers.Add("Rating", new GridRatingCellRenderer(new GridRatingControl(), this.sfDataGrid));
+
+ var data = new EmployeeCollection();
+ sfDataGrid.DataSource = data.EmployeeDetails;
+
+ NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
+ numberFormat.CurrencyDecimalDigits = 0;
+ numberFormat.CurrencyGroupSizes = new int[] { };
+ numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
+ numberFormat.NumberDecimalDigits = 0;
+ numberFormat.NumberGroupSizes = new int[] { };
+
+ this.sfDataGrid.Columns.Add(new GridCheckBoxColumn { MappingName = "Selected", HeaderText = "", AllowCheckBoxOnHeader = true, CheckBoxSize = new Size(13, 13) });
+ this.sfDataGrid.Columns.Add(new GridImageColumn() { MappingName = "EmployeeName", HeaderText = "Employee Name", ImageLayout = ImageLayout.None });
+ this.sfDataGrid.Columns.Add(new GridTextColumn() { MappingName = "Designation", HeaderText = "Designation" });
+ this.sfDataGrid.Columns.Add(new GridTextColumn() { MappingName = "Mail", HeaderText = "Mail" });
+ this.sfDataGrid.Columns.Add(new GridImageColumn() { MappingName = "Location", TextImageRelation = TextImageRelation.ImageBeforeText, Width = 100 });
+ this.sfDataGrid.Columns.Add(new GridTextColumn { MappingName = "Status", HeaderText = "Status" });
+ this.sfDataGrid.Columns.Add(new GridImageColumn() { MappingName = "Trustworthiness", HeaderText = "Trustworthiness" });
+ this.sfDataGrid.Columns.Add(new GridRatingColumn() { MappingName = "Rating", Width = 140, AllowFiltering = false, AllowSorting = false });
+ this.sfDataGrid.Columns.Add(new GridNumericColumn { MappingName = "Salary", HeaderText = "Salary", FormatMode = FormatMode.Currency, NumberFormatInfo = numberFormat });
+ this.sfDataGrid.Columns.Add(new GridTextColumn() { MappingName = "Address", HeaderText = "Address" });
+ this.sfDataGrid.Columns.Add(new GridProgressBarColumn() { MappingName = "SoftwareProficiency", HeaderText = "Software Proficiency", Maximum = 100, Minimum = 0, ValueMode = ProgressBarValueMode.Percentage });
+
+ this.sfDataGrid.Style.ProgressBarStyle.TextColor = Color.Black;
+ this.sfDataGrid.Style.ProgressBarStyle.ForegroundColor = Color.CadetBlue;
+ sfDataGrid.QueryImageCellStyle += SfDataGrid_QueryImageCellStyle;
+ sfDataGrid.QueryCellStyle += SfDataGrid_QueryCellStyle;
+
+ //Initialize CustomSelectionController.
+ this.sfDataGrid.SelectionController = new CustomSelectionController(this.sfDataGrid);
+ }
+
+ private void SfDataGrid_QueryCellStyle(object sender, QueryCellStyleEventArgs e)
+ {
+ if (e.Column.MappingName == "Status")
+ {
+ if (e.DisplayText.ToString() == "Active")
+ e.Style.TextColor = Color.Green;
+ else
+ e.Style.TextColor = Color.Red;
+ }
+ }
+
+ private void SfDataGrid_QueryImageCellStyle(object sender, QueryImageCellStyleEventArgs e)
+ {
+ var employee = (Employee)e.Record;
+
+ if (e.Column.MappingName == "Trustworthiness")
+ {
+ if (employee.Trustworthiness.ToString() == "Sufficient")
+ {
+ e.Image = (Image.FromFile(@"..\..\Images\Sufficient.png"));
+ e.DisplayText = (e.Record as Employee).Trustworthiness.ToString();
+ e.TextImageRelation = TextImageRelation.ImageBeforeText;
+ }
+ else if (employee.Trustworthiness.ToString() == "Insufficient")
+ {
+ e.Image = (Image.FromFile(@"..\..\Images\Insufficient.png"));
+ e.DisplayText = (e.Record as Employee).Trustworthiness.ToString();
+ e.TextImageRelation = TextImageRelation.ImageBeforeText;
+ }
+ else if (employee.Trustworthiness.ToString() == "Perfect")
+ {
+ e.Image = (Image.FromFile(@"..\..\Images\Perfect.png"));
+ e.DisplayText = (e.Record as Employee).Trustworthiness.ToString();
+ e.TextImageRelation = TextImageRelation.ImageBeforeText;
+ }
+ }
+ else if (e.Column.MappingName == "EmployeeName")
+ {
+ e.Image = employee.Gender == "1" ? (Image.FromFile(@"..\..\Images\Male.png")) : (Image.FromFile(@"..\..\Images\Female.png"));
+ e.DisplayText = (e.Record as Employee).EmployeeName.ToString();
+ e.TextImageRelation = TextImageRelation.ImageBeforeText;
+ }
+ else
+ {
+ e.Image = (Image.FromFile(@"..\..\Images\location.png"));
+ e.DisplayText = (e.Record as Employee).Location.ToString();
+ e.TextImageRelation = TextImageRelation.ImageBeforeText;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/RatingColumn/Form1.resx b/RatingColumn/Form1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/RatingColumn/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/RatingColumn/GettingStarted_2010.csproj b/RatingColumn/GettingStarted_2010.csproj
new file mode 100644
index 0000000..e30fe29
--- /dev/null
+++ b/RatingColumn/GettingStarted_2010.csproj
@@ -0,0 +1,107 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {6B868F00-FBDE-4705-A2EE-13913F7A2301}
+ WinExe
+ Properties
+ GettingStarted
+ GettingStarted
+ v4.0
+ 512
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/RatingColumn/GettingStarted_2010.sln b/RatingColumn/GettingStarted_2010.sln
new file mode 100644
index 0000000..22d97b3
--- /dev/null
+++ b/RatingColumn/GettingStarted_2010.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted_2010", "GettingStarted_2010.csproj", "{6B868F00-FBDE-4705-A2EE-13913F7A2301}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6B868F00-FBDE-4705-A2EE-13913F7A2301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6B868F00-FBDE-4705-A2EE-13913F7A2301}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6B868F00-FBDE-4705-A2EE-13913F7A2301}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6B868F00-FBDE-4705-A2EE-13913F7A2301}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/RatingColumn/GettingStarted_2012.csproj b/RatingColumn/GettingStarted_2012.csproj
new file mode 100644
index 0000000..74a3928
--- /dev/null
+++ b/RatingColumn/GettingStarted_2012.csproj
@@ -0,0 +1,108 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}
+ WinExe
+ Properties
+ GettingStarted
+ GettingStarted
+ v4.5
+ 512
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/RatingColumn/GettingStarted_2012.sln b/RatingColumn/GettingStarted_2012.sln
new file mode 100644
index 0000000..2c682b7
--- /dev/null
+++ b/RatingColumn/GettingStarted_2012.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted_2012", "GettingStarted_2012.csproj", "{3839D384-FF5F-4FB9-B1D1-7918E512B434}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/RatingColumn/GettingStarted_2013.csproj b/RatingColumn/GettingStarted_2013.csproj
new file mode 100644
index 0000000..635a201
--- /dev/null
+++ b/RatingColumn/GettingStarted_2013.csproj
@@ -0,0 +1,108 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}
+ WinExe
+ Properties
+ GettingStarted
+ GettingStarted
+ v4.5.1
+ 512
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ 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/RatingColumn/GettingStarted_2013.sln b/RatingColumn/GettingStarted_2013.sln
new file mode 100644
index 0000000..f3fba79
--- /dev/null
+++ b/RatingColumn/GettingStarted_2013.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted_2013", "GettingStarted_2013.csproj", "{3839D384-FF5F-4FB9-B1D1-7918E512B434}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/RatingColumn/GettingStarted_2015.csproj b/RatingColumn/GettingStarted_2015.csproj
new file mode 100644
index 0000000..e8fa080
--- /dev/null
+++ b/RatingColumn/GettingStarted_2015.csproj
@@ -0,0 +1,110 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}
+ WinExe
+ Properties
+ GettingStarted
+ GettingStarted
+ v4.6
+ 512
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/RatingColumn/GettingStarted_2015.sln b/RatingColumn/GettingStarted_2015.sln
new file mode 100644
index 0000000..3122ec9
--- /dev/null
+++ b/RatingColumn/GettingStarted_2015.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted_2015", "GettingStarted_2015.csproj", "{3839D384-FF5F-4FB9-B1D1-7918E512B434}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/RatingColumn/GettingStarted_2017.csproj b/RatingColumn/GettingStarted_2017.csproj
new file mode 100644
index 0000000..82a521e
--- /dev/null
+++ b/RatingColumn/GettingStarted_2017.csproj
@@ -0,0 +1,107 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}
+ WinExe
+ Properties
+ GettingStarted
+ GettingStarted
+ v4.6
+ 512
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ 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/RatingColumn/GettingStarted_2017.sln b/RatingColumn/GettingStarted_2017.sln
new file mode 100644
index 0000000..9691c70
--- /dev/null
+++ b/RatingColumn/GettingStarted_2017.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted_2017", "GettingStarted_2017.csproj", "{3839D384-FF5F-4FB9-B1D1-7918E512B434}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3839D384-FF5F-4FB9-B1D1-7918E512B434}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/RatingColumn/Images/Female.png b/RatingColumn/Images/Female.png
new file mode 100644
index 0000000..52c584a
Binary files /dev/null and b/RatingColumn/Images/Female.png differ
diff --git a/RatingColumn/Images/Insufficient.png b/RatingColumn/Images/Insufficient.png
new file mode 100644
index 0000000..d10b396
Binary files /dev/null and b/RatingColumn/Images/Insufficient.png differ
diff --git a/RatingColumn/Images/Male.png b/RatingColumn/Images/Male.png
new file mode 100644
index 0000000..23d42ad
Binary files /dev/null and b/RatingColumn/Images/Male.png differ
diff --git a/RatingColumn/Images/Perfect.png b/RatingColumn/Images/Perfect.png
new file mode 100644
index 0000000..c4349e1
Binary files /dev/null and b/RatingColumn/Images/Perfect.png differ
diff --git a/RatingColumn/Images/Sufficient.png b/RatingColumn/Images/Sufficient.png
new file mode 100644
index 0000000..99e6a6b
Binary files /dev/null and b/RatingColumn/Images/Sufficient.png differ
diff --git a/RatingColumn/Images/location.png b/RatingColumn/Images/location.png
new file mode 100644
index 0000000..12bdb5f
Binary files /dev/null and b/RatingColumn/Images/location.png differ
diff --git a/RatingColumn/Program.cs b/RatingColumn/Program.cs
new file mode 100644
index 0000000..a80ebb4
--- /dev/null
+++ b/RatingColumn/Program.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace GettingStarted
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey());
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+
+ ///
+ /// Represents a class that is used to find the licensing file for Syncfusion controls.
+ ///
+ public class DemoCommon
+ {
+ ///
+ /// Finds the license key from the Common folder.
+ ///
+ /// Returns the license key.
+ public static string FindLicenseKey()
+ {
+ string licenseKeyFile = "..\\Common\\SyncfusionLicense.txt";
+ for (int n = 0; n < 20; n++)
+ {
+ if (!System.IO.File.Exists(licenseKeyFile))
+ {
+ licenseKeyFile = @"..\" + licenseKeyFile;
+ continue;
+ }
+ return System.IO.File.ReadAllText(licenseKeyFile);
+ }
+ return string.Empty;
+ }
+ }
+}
diff --git a/RatingColumn/Properties/AssemblyInfo.cs b/RatingColumn/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ceab898
--- /dev/null
+++ b/RatingColumn/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("GettingStarted")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("GettingStarted")]
+[assembly: AssemblyCopyright("Copyright Syncfusion Inc. 2001 - 2016")]
+[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("2727adc4-282e-41ee-90df-f200f8a51580")]
+
+// 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/RatingColumn/Properties/Resources.Designer.cs b/RatingColumn/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..185c573
--- /dev/null
+++ b/RatingColumn/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 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 GettingStarted.Properties {
+ using System;
+
+
+ ///
+ /// 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 (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GettingStarted.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/RatingColumn/Properties/Resources.resx b/RatingColumn/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/RatingColumn/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/RatingColumn/Properties/Settings.Designer.cs b/RatingColumn/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..d638281
--- /dev/null
+++ b/RatingColumn/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// 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 GettingStarted.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/RatingColumn/Properties/Settings.settings b/RatingColumn/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/RatingColumn/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/RatingColumn/Renderer/CustomSelectionController.cs b/RatingColumn/Renderer/CustomSelectionController.cs
new file mode 100644
index 0000000..0086a8e
--- /dev/null
+++ b/RatingColumn/Renderer/CustomSelectionController.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Interactivity;
+
+namespace GettingStarted
+{
+ ///
+ /// Represents the class that process the selection operation in SfDataGrid.
+ ///
+ public class CustomSelectionController : RowSelectionController
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The DataGrid.
+ public CustomSelectionController(SfDataGrid dataGrid)
+ : base(dataGrid)
+ {
+ }
+
+ ///
+ /// Process the key operations for SfDataGrid.
+ ///
+ /// that contains the event data.
+ public new void HandleKeyOperations(KeyEventArgs e)
+ {
+ base.HandleKeyOperations(e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/RatingColumn/Renderer/GridRatingCellRenderer.cs b/RatingColumn/Renderer/GridRatingCellRenderer.cs
new file mode 100644
index 0000000..d6b0af1
--- /dev/null
+++ b/RatingColumn/Renderer/GridRatingCellRenderer.cs
@@ -0,0 +1,145 @@
+using Syncfusion.Windows.Forms.Tools;
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Interactivity;
+using Syncfusion.WinForms.DataGrid.Renderers;
+using Syncfusion.WinForms.DataGrid.Styles;
+using Syncfusion.WinForms.GridCommon.ScrollAxis;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace GettingStarted
+{
+ ///
+ /// Represents the class that used for drawing the rating cell.
+ ///
+ public class GridRatingCellRenderer : GridCellRendererBase
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The rating control.
+ /// The DataGrid.
+ public GridRatingCellRenderer(GridRatingControl ratingControl, SfDataGrid dataGrid)
+ {
+ IsEditable = false;
+ RatingControl = ratingControl;
+ DataGrid = dataGrid;
+ }
+
+ ///
+ /// Gets or Sets the rating control functionalities.
+ ///
+ protected GridRatingControl RatingControl { get; set; }
+
+ ///
+ /// Gets or Sets to specifies the datagrid.
+ ///
+ protected SfDataGrid DataGrid { get; set; }
+
+ ///
+ /// Overridden to draw the rating of the cell.
+ ///
+ /// The that used to draw the rating.
+ /// The cell rectangle.
+ /// The cell value.
+ /// The CellStyleInfo of the cell.
+ /// The DataColumnBase of the cell.
+ /// The row and column index of the cell.
+ protected override void OnRender(Graphics graphics, Rectangle cellRect, string cellValue, CellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex)
+ {
+ using (SolidBrush brush = new SolidBrush(style.BackColor))
+ graphics.FillRectangle(brush, cellRect);
+
+ var RatingColumn = column.GridColumn as GridRatingColumn;
+ RatingControl.Orientation = Orientationmode.Horizontal;
+ RatingControl.Location = cellRect.Location;
+ var Width = RatingControl.Width;
+ RatingControl.Orientation = Orientationmode.Horizontal;
+ RatingControl.ItemsCount = RatingColumn.ItemCount;
+ RatingControl.Size = cellRect.Size;
+ RatingControl.Shape = RatingColumn.Shape;
+ int value = 0;
+ if (int.TryParse(cellValue, out value))
+ RatingControl.Value = value;
+ RatingControl.ItemSelectionColor = RatingColumn.ItemSelectionColor;
+ RatingControl.ItemBackColor = RatingColumn.ItemBackColor;
+
+ var smoothingMode = graphics.SmoothingMode;
+ graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+
+ int starHeight, starWidth;
+ Rectangle drawArea;
+ var clipBounds = graphics.VisibleClipBounds;
+ graphics.SetClip(cellRect);
+ Rectangle[] m_Itemrectangle = new Rectangle[RatingControl.ItemsCount];
+
+ var padding = 10;
+ cellRect.X += padding;
+ cellRect.Width -= 2 * padding;
+ Width = cellRect.Width;
+
+ starWidth = 16;
+ starHeight = 16;
+
+ var startingPosition = (Width - ((RatingControl.ItemsCount * starWidth) + ((RatingControl.ItemsCount - 1) * RatingControl.Spacing))) / 2;
+ drawArea = new Rectangle(cellRect.X + startingPosition, cellRect.Y + ((cellRect.Height / 2) - (starHeight / 2)), starWidth, starHeight);
+
+ RatingControl.Location = new Point(drawArea.X, drawArea.Y);
+
+ for (int i = 0; i < RatingControl.ItemsCount; ++i)
+ {
+ m_Itemrectangle[i].X = drawArea.X - RatingControl.Spacing / 2;
+ m_Itemrectangle[i].Y = drawArea.Y;
+ m_Itemrectangle[i].Width = drawArea.Width + RatingControl.Spacing / 2;
+ m_Itemrectangle[i].Height = drawArea.Height;
+
+ if (RatingControl.Shape == Shapes.Circle)
+ RatingControl.DrawCircle(graphics, drawArea, i);
+ else if (RatingControl.Shape == Shapes.Heart)
+ RatingControl.DrawHeart(graphics, drawArea, i);
+ else if (RatingControl.Shape == Shapes.CustomImages)
+ RatingControl.DrawCustomShapes(graphics, drawArea, i);
+ else
+ RatingControl.DrawShape(graphics, drawArea, i);
+
+ drawArea.X += drawArea.Width + RatingControl.Spacing;
+ }
+
+ graphics.SetClip(clipBounds);
+ graphics.SmoothingMode = smoothingMode;
+ }
+
+ ///
+ /// Occurs when the key is pressed while the cell has focus.
+ ///
+ /// The DataColumnBase of the cell.
+ /// The row and column index of the cell.
+ /// The that contains the event data.
+ protected override void OnKeyDown(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, KeyEventArgs e)
+ {
+ var selectionController = this.DataGrid.SelectionController as CustomSelectionController;
+ switch (e.KeyCode)
+ {
+ case Keys.Space:
+ case Keys.Down:
+ case Keys.Up:
+ case Keys.Left:
+ case Keys.Right:
+ case Keys.Enter:
+ case Keys.PageDown:
+ case Keys.PageUp:
+ case Keys.Tab:
+ case Keys.Home:
+ case Keys.End:
+ selectionController.HandleKeyOperations(e);
+ break;
+ }
+
+ base.OnKeyDown(dataColumn, rowColumnIndex, e);
+ }
+ }
+}
diff --git a/RatingColumn/Renderer/GridRatingColumn.cs b/RatingColumn/Renderer/GridRatingColumn.cs
new file mode 100644
index 0000000..99e9d04
--- /dev/null
+++ b/RatingColumn/Renderer/GridRatingColumn.cs
@@ -0,0 +1,108 @@
+using Syncfusion.Windows.Forms.Tools;
+using Syncfusion.WinForms.DataGrid;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+
+namespace GettingStarted
+{
+ ///
+ /// Represents a column that used to display the Rating in its cell.
+ ///
+ public class GridRatingColumn : GridColumn
+ {
+ ///
+ /// Specifies the selection color of the rating.
+ ///
+ private Color itemSelectionColor = ColorTranslator.FromHtml("#FFB223");
+
+ ///
+ /// Specifies the back color of the rating.
+ ///
+ private Color itemBackColor = ColorTranslator.FromHtml("#D8D8D8");
+
+ ///
+ /// Specifies the shapes for the rating.
+ ///
+ private Shapes shape = Shapes.Star;
+
+ ///
+ /// Specfies the count of the rating.
+ ///
+ private int itemCount = 5;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GridRatingColumn()
+ {
+ SetCellType("Rating");
+ }
+
+ ///
+ /// Gets or Sets the selection color of the rating.
+ ///
+ public Color ItemSelectionColor
+ {
+ get
+ {
+ return itemSelectionColor;
+ }
+
+ set
+ {
+ itemSelectionColor = value;
+ }
+ }
+
+ ///
+ /// Gets or Sets the back color of the rating.
+ ///
+ public Color ItemBackColor
+ {
+ get
+ {
+ return itemBackColor;
+ }
+
+ set
+ {
+ itemBackColor = value;
+ }
+ }
+
+ ///
+ /// Gets or Sets the shapes for the rating.
+ ///
+ public Shapes Shape
+ {
+ get
+ {
+ return shape;
+ }
+
+ set
+ {
+ shape = value;
+ }
+ }
+
+ ///
+ /// Gets or Sets the count of the rating.
+ ///
+ public int ItemCount
+ {
+ get
+ {
+ return itemCount;
+ }
+
+ set
+ {
+ itemCount = value;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/RatingColumn/Renderer/GridRatingControl.cs b/RatingColumn/Renderer/GridRatingControl.cs
new file mode 100644
index 0000000..b3a8720
--- /dev/null
+++ b/RatingColumn/Renderer/GridRatingControl.cs
@@ -0,0 +1,227 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Syncfusion.Windows.Forms;
+using Syncfusion.Windows.Forms.Tools;
+using System.ComponentModel;
+using System.Drawing;
+using Syncfusion.WinForms.Core.Utils;
+using System.Drawing.Drawing2D;
+using DpiAware = Syncfusion.WinForms.Core.Utils.DpiAware;
+
+namespace GettingStarted
+{
+ ///
+ /// Rating Control Class in which all the functionalities of the rating control has been defined.
+ ///
+ [ToolboxItem(false)]
+ public class GridRatingControl : RatingControl
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GridRatingControl()
+ {
+ }
+
+ ///
+ /// Draws the Circle shape
+ ///
+ /// The that used to draw the rating.
+ /// The rectangle of the cell.
+ /// Rating item index count.
+ public new void DrawCircle(Graphics graphics, Rectangle rectangle, int starAreaIndex)
+ {
+ base.DrawCircle(graphics, rectangle, starAreaIndex);
+ }
+
+ ///
+ /// Draws the Circle shape
+ ///
+ /// The that used to draw the rating.
+ /// The rectangle of the cell.
+ /// Rating item index count.
+ public new void DrawCustomShapes(Graphics graphics, Rectangle rectangle, int starAreaIndex)
+ {
+ base.DrawCustomShapes(graphics, rectangle, starAreaIndex);
+ }
+
+ ///
+ /// Draws the Heart shape
+ ///
+ /// The that used to draw the rating.
+ /// The rectangle of the cell.
+ /// Rating item index count.
+ public new void DrawHeart(Graphics g, Rectangle rect, int starAreaIndex)
+ {
+ Brush fillBrush = new SolidBrush(ItemBackColor);
+ Pen outlinePen = new Pen(ItemBorderColor, ItemBorderWeight);
+ Pen mousedownpen = new Pen(ItemBorderColor, ItemBorderWeight);
+ fillBrush = new SolidBrush(ItemBackColor);
+ Size defaultItemSize = new Size(22, 22);
+
+ GridRatingColumn RatingColumn = new GridRatingColumn();
+ GraphicsPath gpfull = new GraphicsPath();
+ var controlY = this.Location.Y;
+ gpfull.AddLine(rect.X + rect.Width / 2, (controlY) + rect.Height, rect.X, (controlY) + (rect.Height / 2) - 3);
+ gpfull.AddArc(rect.X, rect.Y, rect.Width / 2, (rect.Height / 2) - 3, 180, 180);
+ gpfull.AddArc(rect.X + (rect.Width / 2), rect.Y, rect.Width / 2, (rect.Height / 2) - 3, 180, 180);
+ gpfull.AddLine(rect.X + rect.Width, (controlY) + (rect.Height / 2) - 3, rect.X + rect.Width / 2, (controlY) + rect.Height);
+ GraphicsPath gphalf = new GraphicsPath();
+ gphalf.AddArc(rect.X, rect.Y, rect.Width / 2, (rect.Height / 2) - 3, 180, 180);
+ gphalf.AddLines(new PointF[] { new PointF(rect.X + rect.Width / 2, rect.Height / 2), new PointF(rect.X + rect.Width / 2, rect.Height), new PointF(rect.X, rect.Height / 2) });
+ gphalf.AddArc(rect.X, rect.Y, rect.Width / 2, (rect.Height / 2) - 3, 180, 180);
+ gphalf.AddArc(rect.X, rect.Y, rect.Width / 2, (rect.Height / 2) - 3, 180, 180);
+ g.FillPath(fillBrush, gpfull);
+ g.SmoothingMode = SmoothingMode.AntiAlias;
+ g.DrawPath(outlinePen, gpfull);
+ fillBrush.Dispose();
+ outlinePen.Dispose();
+ mousedownpen.Dispose();
+ }
+
+ ///
+ /// Draws the shape
+ ///
+ /// The that used to draw the rating.
+ /// The rectangle of the cell.
+ /// Rating item index count.
+ public new void DrawShape(Graphics g, Rectangle rect, int starAreaIndex)
+ {
+ Brush fillBrush = new SolidBrush(ItemBackColor);
+ Pen outlinePen = new Pen(ItemBorderColor, ItemBorderWeight);
+ Pen mousedownpen = new Pen(ItemBorderColor, ItemBorderWeight);
+ outlinePen = new Pen(ItemBorderColor, ItemBorderWeight);
+
+ if (Value > starAreaIndex)
+ fillBrush = new SolidBrush(ItemSelectionColor);
+ else
+ fillBrush = new SolidBrush(ItemBackColor);
+ PointF[] fullselection = GetFullPoints(rect);
+ PointF[] p = fullselection;
+ g.SmoothingMode = SmoothingMode.HighQuality;
+ g.FillPolygon(fillBrush, p);
+ g.DrawPolygon(outlinePen, fullselection);
+
+ fillBrush.Dispose();
+ outlinePen.Dispose();
+ mousedownpen.Dispose();
+ }
+
+ ///
+ /// Gets the shapes points for the rating.
+ ///
+ /// The rectangle.
+ /// Returns points for rating.
+ private PointF[] GetFullPoints(Rectangle rect)
+ {
+ if (Orientation == Orientationmode.Vertical)
+ return null;
+
+ PointF[] p1;
+ Size defaultItemSize = new Size(22, 22);
+ var controlY = this.Location.Y;
+
+ if (ItemSize == defaultItemSize)
+ {
+ if (Shape == Shapes.Star)
+ {
+ p1 = new PointF[] {
+ new PointF( rect.X,(controlY) + (rect.Height)/2-DpiAware.LogicalToDeviceUnits(1)),
+ new PointF(rect.X+(rect.Width/2)-DpiAware.LogicalToDeviceUnits(3),(controlY) +(rect.Height/2)-DpiAware.LogicalToDeviceUnits(1)),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF((rect.X+(rect.Width/2)+DpiAware.LogicalToDeviceUnits(3)),(controlY) +(rect.Height/2)-DpiAware.LogicalToDeviceUnits(1)),
+ new PointF(rect.X+rect.Width,(controlY) +rect.Height/2-DpiAware.LogicalToDeviceUnits(1)),
+ new PointF(rect.X+(rect.Width/2)+DpiAware.LogicalToDeviceUnits(4),(controlY) +(rect.Height/2)+DpiAware.LogicalToDeviceUnits(3)),
+ new PointF(rect.X+rect.Width-DpiAware.LogicalToDeviceUnits(3),(controlY) + rect.Height),
+ new PointF(rect.X+rect.Width/2,(controlY) +(rect.Height/2)+DpiAware.LogicalToDeviceUnits(6)),
+ new PointF(rect.X+DpiAware.LogicalToDeviceUnits(3),(controlY) +rect.Height),
+ new PointF(rect.X+(rect.Width/2)-DpiAware.LogicalToDeviceUnits(4),(controlY) +(rect.Height/2)+DpiAware.LogicalToDeviceUnits(3)),
+ new PointF(rect.X,(controlY) +(rect.Height)/2-DpiAware.LogicalToDeviceUnits(1))
+ };
+ }
+ else if (Shape == Shapes.Triangle)
+ {
+ p1 = new PointF[] {
+ new PointF(rect.X,(controlY) +rect.Height),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF(rect.X+(rect.Width),(controlY) +rect.Height),
+ new PointF(rect.X,(controlY) +rect.Height),
+ };
+ }
+ else if (Shape == Shapes.Kite)
+ {
+ p1 = new PointF[] {
+ new PointF(rect.X,(controlY) +(rect.Height)/2-DpiAware.LogicalToDeviceUnits(5)),
+ new PointF(rect.X+rect.Width/2,rect.Y),
+ new PointF(rect.X+rect.Width,(controlY) +(rect.Height)/2-DpiAware.LogicalToDeviceUnits(5)),
+ new PointF(rect.X+(rect.Width/2)-DpiAware.LogicalToDeviceUnits(6),(controlY) +rect.Height),
+ new PointF(rect.X+(rect.Width/2)+DpiAware.LogicalToDeviceUnits(6),(controlY) +rect.Height),
+ new PointF(rect.X,(controlY) +(rect.Height)/2-DpiAware.LogicalToDeviceUnits(5))
+ };
+ }
+ else
+ {
+ p1 = new PointF[] {
+ new PointF( rect.X,(controlY) + rect.Height/2),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF(rect.X+rect.Width,(controlY) + rect.Height/2),
+ new PointF(rect.X+rect.Width/2,(controlY) + rect.Height),
+ new PointF(rect.X,(controlY) + rect.Height/2),
+ };
+ }
+ }
+ else
+ {
+ if (Shape == Shapes.Star)
+ {
+ p1 = new PointF[] {
+ new PointF( rect.X,(controlY) + (rect.Height)/2-1),
+ new PointF(rect.X+(rect.Width/2)-3,(controlY) + (rect.Height/2)-1),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF((rect.X+(rect.Width/2)+3),(controlY) + (rect.Height/2)-1),
+ new PointF(rect.X+rect.Width,(controlY) + rect.Height/2-1),
+ new PointF(rect.X+(rect.Width/2)+4,(controlY) + (rect.Height/2)+3),
+ new PointF(rect.X+rect.Width-3,(controlY) + rect.Height),
+ new PointF(rect.X+rect.Width/2,(controlY) + (rect.Height/2)+6),
+ new PointF(rect.X+3,(controlY) + rect.Height),
+ new PointF(rect.X+(rect.Width/2)-4,(controlY) + (rect.Height/2)+3),
+ new PointF(rect.X,(controlY) + (rect.Height)/2-1)
+ };
+ }
+ else if (Shape == Shapes.Triangle)
+ {
+ p1 = new PointF[] {
+ new PointF(rect.X,(controlY) + rect.Height),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF(rect.X+(rect.Width),(controlY) + rect.Height),
+ new PointF(rect.X,(controlY) + rect.Height),
+ };
+ }
+ else if (Shape == Shapes.Kite)
+ {
+ p1 = new PointF[] {
+ new PointF(rect.X,(controlY) + (rect.Height)/2-5),
+ new PointF(rect.X+rect.Width/2,rect.Y),
+ new PointF(rect.X+rect.Width,(controlY) + (rect.Height)/2-5),
+ new PointF(rect.X+(rect.Width/2)-6,(controlY) + rect.Height),
+ new PointF(rect.X+(rect.Width/2)+6,(controlY) + rect.Height),
+ new PointF(rect.X,(controlY) + (rect.Height)/2-5)
+ };
+ }
+ else
+ {
+ p1 = new PointF[] {
+ new PointF( rect.X,(controlY) + rect.Height/2),
+ new PointF(rect.X+(rect.Width/2),rect.Y),
+ new PointF(rect.X+rect.Width,(controlY) + rect.Height/2),
+ new PointF(rect.X+rect.Width/2,(controlY) + rect.Height),
+ new PointF(rect.X,(controlY) + rect.Height/2),
+ };
+ }
+ }
+ return p1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/SparklineColumn/Form1.Designer.cs b/SparklineColumn/Form1.Designer.cs
new file mode 100644
index 0000000..d7f9c04
--- /dev/null
+++ b/SparklineColumn/Form1.Designer.cs
@@ -0,0 +1,71 @@
+using Syncfusion.Windows.Forms.Chart;
+
+namespace SparklineColumn
+{
+ 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()
+ {
+ this.sfDataGrid1 = new Syncfusion.WinForms.DataGrid.SfDataGrid();
+ ((System.ComponentModel.ISupportInitialize)(this.sfDataGrid1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // sfDataGrid1
+ //
+ this.sfDataGrid1.AccessibleName = "Table";
+ this.sfDataGrid1.AutoSizeColumnsMode = Syncfusion.WinForms.DataGrid.Enums.AutoSizeColumnsMode.Fill;
+ this.sfDataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.sfDataGrid1.Location = new System.Drawing.Point(0, 0);
+ this.sfDataGrid1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.sfDataGrid1.Name = "sfDataGrid1";
+ this.sfDataGrid1.RowHeight = 21;
+ this.sfDataGrid1.ShowGroupDropArea = false;
+ this.sfDataGrid1.Size = new System.Drawing.Size(869, 553);
+ this.sfDataGrid1.TabIndex = 1;
+ this.sfDataGrid1.Text = "sfDataGrid1";
+ //
+ // Form1
+ //
+ this.BackColor = System.Drawing.Color.White;
+ this.ClientSize = new System.Drawing.Size(869, 553);
+ this.Controls.Add(this.sfDataGrid1);
+ this.Margin = new System.Windows.Forms.Padding(5);
+ this.MinimumSize = new System.Drawing.Size(500, 400);
+ this.Name = "Form1";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Sparkline Column";
+ ((System.ComponentModel.ISupportInitialize)(this.sfDataGrid1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Syncfusion.WinForms.DataGrid.SfDataGrid sfDataGrid1;
+ }
+}
+
diff --git a/SparklineColumn/Form1.cs b/SparklineColumn/Form1.cs
new file mode 100644
index 0000000..9d529b9
--- /dev/null
+++ b/SparklineColumn/Form1.cs
@@ -0,0 +1,98 @@
+using SparklineColumn;
+using SparklineColumn;
+using Syncfusion.Windows.Forms.Chart;
+using Syncfusion.WinForms.DataGrid;
+using System;
+using System.Data;
+using System.Drawing;
+using System.Globalization;
+using System.Windows.Forms;
+
+namespace SparklineColumn
+{
+ public partial class Form1 : Form
+ {
+ #region Constructor
+ ///
+ /// Initializes a new instance for Form1.
+ ///
+ public Form1()
+ {
+ InitializeComponent();
+
+ this.sfDataGrid1.AutoGenerateColumns = false;
+ sfDataGrid1.DataSource = GetDataTable();
+ this.sfDataGrid1.CellRenderers.Add("Sparkline", new GridSparklineCellRenderer(new Syncfusion.Windows.Forms.Chart.SparkLine(), this.sfDataGrid1));
+
+ NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
+ numberFormat.CurrencyDecimalDigits = 0;
+ numberFormat.CurrencyGroupSizes = new int[] { };
+ numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
+ numberFormat.NumberDecimalDigits = 0;
+ numberFormat.NumberGroupSizes = new int[] { };
+
+ this.sfDataGrid1.Columns.Add(new GridTextColumn { AllowEditing = true, MappingName = "Geography", HeaderText = "Geography" });
+ this.sfDataGrid1.Columns.Add(new GridNumericColumn { AllowEditing = true, MappingName = "Value", HeaderText = "Value", NumberFormatInfo = numberFormat });
+ this.sfDataGrid1.Columns.Add(new GridNumericColumn { AllowEditing = true, MappingName = "Tons", HeaderText = "Tons", NumberFormatInfo = numberFormat });
+ this.sfDataGrid1.Columns.Add(new GridNumericColumn { AllowEditing = true, MappingName = "Ton-miles", HeaderText = "Ton-miles", NumberFormatInfo = numberFormat });
+ this.sfDataGrid1.Columns.Add(new GridNumericColumn { AllowEditing = true, MappingName = "Average miles", HeaderText = "Average miles", NumberFormatInfo = numberFormat });
+ this.sfDataGrid1.Columns.Add(new GridSparklineColumn() { MappingName = "Sparkline", HeaderText = "Analysis Report", Width = 150, AllowFiltering = false });
+
+ StackedHeaderRow stackedHeaderRow1 = new StackedHeaderRow();
+ stackedHeaderRow1.StackedColumns.Add(new StackedColumn() { ChildColumns = "Geography,Value,Tons,Ton-miles,Average miles,Sparkline", HeaderText = "WHOLESALE TRADE" });
+ this.sfDataGrid1.StackedHeaderRows.Add(stackedHeaderRow1);
+
+ //Initialize CustomSelectionController.
+ this.sfDataGrid1.SelectionController = new CustomSelectionController(this.sfDataGrid1);
+ }
+
+ public DataTable GetDataTable()
+ {
+ DataTable employeeCollection = new DataTable();
+
+ employeeCollection.Columns.Add("Geography", typeof(string));
+ employeeCollection.Columns[0].ColumnName = "Geography";
+ employeeCollection.Columns.Add("Value", typeof(int));
+ employeeCollection.Columns["Value"].ColumnName = "Value";
+ employeeCollection.Columns.Add("Tons", typeof(int));
+ employeeCollection.Columns["Tons"].ColumnName = "Tons";
+ employeeCollection.Columns.Add("Ton-miles", typeof(int));
+ employeeCollection.Columns["Ton-miles"].ColumnName = "Ton-miles";
+ employeeCollection.Columns.Add("Average miles", typeof(int));
+ employeeCollection.Columns["Average miles"].ColumnName = "Average miles";
+ employeeCollection.Columns.Add("Sparkline", typeof(double[]));
+ employeeCollection.Columns["Sparkline"].ColumnName = "Sparkline";
+
+ Random r = new Random(1);
+
+ employeeCollection.Rows.Add("United States", 216817, 7305, 6398, 1169, new double[] { r.Next(1, 7), r.Next(-12, -6), r.Next(1, 12), r.Next(-25, -5), r.Next(7, 13), r.Next(-10, -7) });
+ employeeCollection.Rows.Add("Alabama", 2077, 109, 92, 864, new double[] { r.Next(15, 20), r.Next(-13, -1), r.Next(1, 6), r.Next(-12, -10), r.Next(6, 10), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("Alaska", 45, -2334, 123, 1224, new double[] { r.Next(7, 9), r.Next(-13, -1), r.Next(10, 26), r.Next(-18, -16), r.Next(1, 4), r.Next(-2, -1) });
+ employeeCollection.Rows.Add("Arizona", 88, 34, 52, 1616, new double[] { r.Next(9, 11), r.Next(-5, -1), r.Next(2, 5), r.Next(-2, -1), r.Next(5, 10), r.Next(-17, -10) });
+ employeeCollection.Rows.Add("Arkansas", 12, 455, 33, 1234, new double[] { r.Next(10, 20), r.Next(-20, -10), r.Next(10, 25), r.Next(-20, -10), r.Next(10, 20), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("California", 26205, 1142, -1239, 1759, new double[] { r.Next(1, 4), r.Next(-5, -1), r.Next(10, 25), r.Next(-22, -10), r.Next(7, 10), r.Next(-8, -1) });
+ employeeCollection.Rows.Add("Colorado", 1978, -56, 78, 1298, new double[] { r.Next(15, 20), r.Next(-13, -1), r.Next(1, 6), r.Next(-12, -10), r.Next(6, 10), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("Connecticut", 2639, -67, 45, 1150, new double[] { r.Next(10, 20), r.Next(-10, -1), r.Next(6, 25), r.Next(-18, -8), r.Next(10, 12), r.Next(-12, -10) });
+ employeeCollection.Rows.Add("Delaware", 33, 222, 1666, 2343, new double[] { r.Next(1, 7), r.Next(-12, -6), r.Next(1, 12), r.Next(-25, -5), r.Next(7, 13), r.Next(-10, -7) });
+ employeeCollection.Rows.Add("District of Columbia", -44, 344, 211, 1125, new double[] { r.Next(10, 20), r.Next(-20, -10), r.Next(10, 25), r.Next(-20, -10), r.Next(10, 20), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("Florida", 13983, 87, 102, 1261, new double[] { r.Next(7, 9), r.Next(-13, -1), r.Next(10, 26), r.Next(-18, -16), r.Next(1, 4), r.Next(-2, -1) });
+ employeeCollection.Rows.Add("Georgia", 4273, 439, 257, 953, new double[] { r.Next(10, 20), r.Next(-10, -1), r.Next(6, 25), r.Next(-18, -8), r.Next(10, 12), r.Next(-12, -10) });
+ employeeCollection.Rows.Add("United States", -4740065, 3605531, 767100, -430, new double[] { r.Next(15, 20), r.Next(-13, -1), r.Next(1, 6), r.Next(-12, -10), r.Next(6, 10), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("Alabama", 56928, 85990, 7274, 209, new double[] { r.Next(1, 4), r.Next(-5, -1), r.Next(10, 25), r.Next(-22, -10), r.Next(7, 10), r.Next(-8, -1) });
+ employeeCollection.Rows.Add("Alaska", 6980, 8117, -1662, 165, new double[] { r.Next(9, 11), r.Next(-5, -1), r.Next(2, 5), r.Next(-2, -1), r.Next(5, 10), r.Next(-17, -10) });
+ employeeCollection.Rows.Add("Arizona", -186188, 137209, -23287, 11322, new double[] { r.Next(10, 20), r.Next(-10, -1), r.Next(6, 25), r.Next(-18, -8), r.Next(10, 12), r.Next(-12, -10) });
+ employeeCollection.Rows.Add("Arkansas", 64891, 35286, 4716, 424, new double[] { r.Next(1, 4), r.Next(-5, -1), r.Next(10, 25), r.Next(-22, -10), r.Next(7, 10), r.Next(-8, -1) });
+ employeeCollection.Rows.Add("California", 32849, -35842, 8219, -284, new double[] { r.Next(7, 9), r.Next(-13, -1), r.Next(10, 26), r.Next(-18, -16), r.Next(1, 4), r.Next(-2, -1) });
+ employeeCollection.Rows.Add("Colorado", 712428, 333121, -75089, 838, new double[] { r.Next(9, 11), r.Next(-5, -1), r.Next(2, 5), r.Next(-2, -1), r.Next(5, 10), r.Next(-17, -10) });
+ employeeCollection.Rows.Add("Connecticut", 66463, -36268, 9612, 354, new double[] { r.Next(15, 20), r.Next(-13, -1), r.Next(1, 6), r.Next(-12, -10), r.Next(6, 10), r.Next(-20, -10) });
+ employeeCollection.Rows.Add("Delaware", -64026, 39098, 6466, 317, new double[] { r.Next(1, 7), r.Next(-12, -6), r.Next(1, 12), r.Next(-25, -5), r.Next(7, 13), r.Next(-10, -7) });
+ employeeCollection.Rows.Add("District of Columbia", 6911, 8261, 812, 166, new double[] { r.Next(9, 11), r.Next(-5, -1), r.Next(2, 5), r.Next(-2, -1), r.Next(5, 10), r.Next(-17, -10) });
+ employeeCollection.Rows.Add("Florida", 2290, -1000, 27, 40, new double[] { r.Next(1, 4), r.Next(-5, -1), r.Next(10, 25), r.Next(-22, -10), r.Next(7, 10), r.Next(-8, -1) });
+ employeeCollection.Rows.Add("Georgia", -241776, 190134, 30778, 302, new double[] { r.Next(7, 9), r.Next(-13, -1), r.Next(10, 26), r.Next(-18, -16), r.Next(1, 4), r.Next(-2, -1) });
+
+ return employeeCollection;
+ }
+
+ #endregion
+ }
+}
diff --git a/SparklineColumn/Form1.resx b/SparklineColumn/Form1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/SparklineColumn/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/SparklineColumn/Program.cs b/SparklineColumn/Program.cs
new file mode 100644
index 0000000..2b7949f
--- /dev/null
+++ b/SparklineColumn/Program.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace SparklineColumn
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey());
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+
+ ///
+ /// Represents a class that is used to find the licensing file for Syncfusion controls.
+ ///
+ public class DemoCommon
+ {
+ ///
+ /// Finds the license key from the Common folder.
+ ///
+ /// Returns the license key.
+ public static string FindLicenseKey()
+ {
+ string licenseKeyFile = "..\\Common\\SyncfusionLicense.txt";
+ for (int n = 0; n < 20; n++)
+ {
+ if (!System.IO.File.Exists(licenseKeyFile))
+ {
+ licenseKeyFile = @"..\" + licenseKeyFile;
+ continue;
+ }
+ return System.IO.File.ReadAllText(licenseKeyFile);
+ }
+ return string.Empty;
+ }
+ }
+}
diff --git a/SparklineColumn/Properties/AssemblyInfo.cs b/SparklineColumn/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..080da1d
--- /dev/null
+++ b/SparklineColumn/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("Filtering_DBSample")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Filtering_DBSample")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[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("24bce8dc-08ec-4b3c-995a-94e47e57b547")]
+
+// 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/SparklineColumn/Properties/Resources.Designer.cs b/SparklineColumn/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..4ba7ece
--- /dev/null
+++ b/SparklineColumn/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 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 SparklineColumn.Properties {
+ using System;
+
+
+ ///
+ /// 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", "15.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 (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SparklineColumn.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/SparklineColumn/Properties/Resources.resx b/SparklineColumn/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/SparklineColumn/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/SparklineColumn/Properties/Settings.Designer.cs b/SparklineColumn/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..72419c6
--- /dev/null
+++ b/SparklineColumn/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// 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 SparklineColumn.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.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/SparklineColumn/Properties/Settings.settings b/SparklineColumn/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/SparklineColumn/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/SparklineColumn/Renderer/CustomSelectionController.cs b/SparklineColumn/Renderer/CustomSelectionController.cs
new file mode 100644
index 0000000..ff4e1cd
--- /dev/null
+++ b/SparklineColumn/Renderer/CustomSelectionController.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Interactivity;
+
+namespace SparklineColumn
+{
+ ///
+ /// Represents the class that process the selection operation in SfDataGrid.
+ ///
+ public class CustomSelectionController : RowSelectionController
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The DataGrid.
+ public CustomSelectionController(SfDataGrid dataGrid)
+ : base(dataGrid)
+ {
+ }
+
+ ///
+ /// Process the key operations for SfDataGrid.
+ ///
+ /// that contains the event data.
+ public new void HandleKeyOperations(KeyEventArgs e)
+ {
+ base.HandleKeyOperations(e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/SparklineColumn/Renderer/GridSparkLineCellRenderer.cs b/SparklineColumn/Renderer/GridSparkLineCellRenderer.cs
new file mode 100644
index 0000000..0385ec8
--- /dev/null
+++ b/SparklineColumn/Renderer/GridSparkLineCellRenderer.cs
@@ -0,0 +1,351 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Windows.Forms;
+using Syncfusion.Drawing;
+using Syncfusion.Windows.Forms.Chart;
+using Syncfusion.WinForms.DataGrid;
+using Syncfusion.WinForms.DataGrid.Interactivity;
+using Syncfusion.WinForms.DataGrid.Renderers;
+using Syncfusion.WinForms.DataGrid.Styles;
+using Syncfusion.WinForms.GridCommon.ScrollAxis;
+
+namespace SparklineColumn
+{
+ ///
+ /// Represents the class that used for drawing the spark line cell.
+ ///
+ public class GridSparklineCellRenderer : GridCellRendererBase
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The sparkline.
+ /// The DataGrid.
+ public GridSparklineCellRenderer(Syncfusion.Windows.Forms.Chart.SparkLine sparkline, SfDataGrid dataGrid)
+ {
+ Sparkline = sparkline;
+ DataGrid = dataGrid;
+ IsEditable = false;
+ }
+
+ ///
+ /// Gets or Sets to specifies the datagrid.
+ ///
+ protected SfDataGrid DataGrid { get; set; }
+
+ ///
+ /// Gets the Sparkline control used to draw the SparkLine.
+ ///
+ protected SparkLine Sparkline { get; set; }
+
+ ///
+ ///Renders the line type Sparkline.
+ ///
+ ///The instance containing the event data.
+ ///The Sparkline.
+ public void DrawSparkline(Graphics graphics, Syncfusion.Windows.Forms.Chart.SparkLine sparkline)
+ {
+ SparkLineSource sparkLineSource = new SparkLineSource();
+ int areaMarginX = 3;
+ int areaMarginY = 3;
+ double firstPointX = 0, firstPointY = 0, secondPointX = 0, secondPointY = 0;
+ double areaWidth = sparkline.ControlWidth - areaMarginX * areaMarginX;
+ double areaHeight = sparkline.ControlHeight - areaMarginY * areaMarginY;
+
+ var sourceList = (List