Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Start work #76

Merged
merged 3 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Source/Krypton Toolkit/Examples/DataGridView/DataGridView.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<LangVersion>latest</LangVersion>
<OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Main\Krypton.Toolkit.Suite.Extended.DataGridView\Krypton.Toolkit.Suite.Extended.DataGridView.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Northwind_small.sqlite">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
101 changes: 101 additions & 0 deletions Source/Krypton Toolkit/Examples/DataGridView/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions Source/Krypton Toolkit/Examples/DataGridView/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Diagnostics;
using System.Windows.Forms;
using Krypton.Toolkit;

namespace DataGridView
{
public partial class Form1 : KryptonForm
{
public Form1()
{
InitializeComponent();
// DB obtained from https://github.com/jpwhite3/northwind-SQLite3/blob/master/Northwind_small.sqlite
string cs = @"URI=file:Northwind_small.sqlite";
using var con = new SQLiteConnection(cs);
con.Open();
DataSet customerOrders = new DataSet();
using (var custAdapter = new SQLiteDataAdapter(@"SELECT * FROM 'Employee'", con))
{
custAdapter.Fill(customerOrders, @"Employees");
}

using (var ordAdapter = new SQLiteDataAdapter(@"SELECT * FROM 'Order'", con))
{
ordAdapter.Fill(customerOrders, @"Orders");
}

//DataRelation relation = customerOrders.Relations.Add("CustOrders",
// customerOrders.Tables["Customers"].Columns["Id"],
// customerOrders.Tables["Orders"].Columns["CustomerId"]);

kryptonDataGridView1.DataSet = customerOrders;
kryptonDataGridView1.SetMasterSource(@"Employees", @"Id");
kryptonDataGridView1.AddSingleDetail(@"Orders", @"EmployeeId");
kryptonDataGridView1.DetailsCellMouseClick += KryptonDataGridView1OnDetailsCellMouseClick;

using (var empTerAdapter = new SQLiteDataAdapter(@"SELECT * FROM 'EmployeeTerritory'", con))
{
empTerAdapter.Fill(customerOrders, @"Territories");
}

kryptonDataGridView2.DataSet = customerOrders;
kryptonDataGridView2.SetMasterSource(@"Employees", @"Id");
kryptonDataGridView2.AddMultiDetail(@"Orders", @"EmployeeId", @"Orders");
kryptonDataGridView2.AddMultiDetail(@"Territories", @"EmployeeId", @"Employee Territories");
kryptonDataGridView2.DetailsCellMouseClick += KryptonDataGridView2OnDetailsCellMouseClick;
}

private void KryptonDataGridView2OnDetailsCellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
Debug.WriteLine(kryptonDataGridView2.DetailsCurrentCell.Value);
}

private void KryptonDataGridView1OnDetailsCellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
Debug.WriteLine(kryptonDataGridView1.DetailsCurrentCell.Value);
}
}
}
60 changes: 60 additions & 0 deletions Source/Krypton Toolkit/Examples/DataGridView/Form1.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file not shown.
23 changes: 23 additions & 0 deletions Source/Krypton Toolkit/Examples/DataGridView/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DataGridView
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
21 changes: 21 additions & 0 deletions Source/Krypton Toolkit/Krypton Toolkit Suite Extended.sln
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Windows.API.Code.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Windows.API.Code.Pack.Dialogs", "Third Party\Microsoft.Windows.API.Code.Pack.Dialogs\Microsoft.Windows.API.Code.Pack.Dialogs.csproj", "{CF97E0B2-24C1-4190-B507-01956E4C162B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krypton.Toolkit.Suite.Extended.DataGridView", "Main\Krypton.Toolkit.Suite.Extended.DataGridView\Krypton.Toolkit.Suite.Extended.DataGridView.csproj", "{8E3EF8E9-27B5-4ED0-96AE-07337413A15A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{20101A7D-50DD-4924-82D1-3E581696843F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataGridView", "Examples\DataGridView\DataGridView.csproj", "{755941EF-B990-4475-9C13-C20837FF037D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -296,6 +302,18 @@ Global
{838FCD3C-9306-427D-9A99-9E68CEFA584C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{838FCD3C-9306-427D-9A99-9E68CEFA584C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{838FCD3C-9306-427D-9A99-9E68CEFA584C}.Release|Any CPU.Build.0 = Release|Any CPU
{903938B3-848C-4B7C-9E44-03AD2F535021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{903938B3-848C-4B7C-9E44-03AD2F535021}.Debug|Any CPU.Build.0 = Debug|Any CPU
{903938B3-848C-4B7C-9E44-03AD2F535021}.Release|Any CPU.ActiveCfg = Release|Any CPU
{903938B3-848C-4B7C-9E44-03AD2F535021}.Release|Any CPU.Build.0 = Release|Any CPU
{8E3EF8E9-27B5-4ED0-96AE-07337413A15A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E3EF8E9-27B5-4ED0-96AE-07337413A15A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E3EF8E9-27B5-4ED0-96AE-07337413A15A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E3EF8E9-27B5-4ED0-96AE-07337413A15A}.Release|Any CPU.Build.0 = Release|Any CPU
{755941EF-B990-4475-9C13-C20837FF037D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{755941EF-B990-4475-9C13-C20837FF037D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{755941EF-B990-4475-9C13-C20837FF037D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{755941EF-B990-4475-9C13-C20837FF037D}.Release|Any CPU.Build.0 = Release|Any CPU
{572B0D12-A04B-4EB9-B5FB-87F66FF91078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{572B0D12-A04B-4EB9-B5FB-87F66FF91078}.Debug|Any CPU.Build.0 = Debug|Any CPU
{572B0D12-A04B-4EB9-B5FB-87F66FF91078}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -375,6 +393,9 @@ Global
{7A5B99D8-8925-4831-9704-2A211C0F470A} = {E311F8C7-1F27-48CD-86BE-CC3D798163BE}
{4C65A943-E114-4535-9C84-1D5CE0612FE0} = {E311F8C7-1F27-48CD-86BE-CC3D798163BE}
{838FCD3C-9306-427D-9A99-9E68CEFA584C} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}
{903938B3-848C-4B7C-9E44-03AD2F535021} = {E311F8C7-1F27-48CD-86BE-CC3D798163BE}
{8E3EF8E9-27B5-4ED0-96AE-07337413A15A} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}
{755941EF-B990-4475-9C13-C20837FF037D} = {20101A7D-50DD-4924-82D1-3E581696843F}
{572B0D12-A04B-4EB9-B5FB-87F66FF91078} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}
{02E3E01C-A4F8-46CD-B157-17E5540C5BFF} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}
{FDD335B3-3293-4E93-B81F-54F84DC6276A} = {252CCB85-EC69-4B0F-9ACB-4C37AE3F54B5}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Windows.Forms.Design;

namespace Krypton.Toolkit.Suite.Extended.DataGridView.Designers
{
internal class MasterMultiDetailViewDesigner : ControlDesigner
{
#region Identity
/// <summary>
/// Initialize a new instance of the KryptonWrapLabelDesigner class.
/// </summary>
public MasterMultiDetailViewDesigner()
{
// The resizing handles around the control need to change depending on the
// value of the AutoSize and AutoSizeMode properties. When in AutoSize you
// do not get the resizing handles, otherwise you do.
AutoResizeHandles = true;
}
#endregion

#region Public Overrides
///// <summary>
///// Gets the design-time action lists supported by the component associated with the designer.
///// </summary>
//public override DesignerActionListCollection ActionLists
//{
// get
// {
// // Create a collection of action lists
// DesignerActionListCollection actionLists = new DesignerActionListCollection();

// // Add the wrap label specific list
// actionLists.Add(new KryptonWrapLabelActionList(this));

// return actionLists;
// }
//}
#endregion
}
}
Binary file not shown.
Loading