Skip to content

Commit 662fc20

Browse files
Merge pull request #1 from kanimozhi-b/master
Add files via upload
2 parents 29fb311 + b522f06 commit 662fc20

13 files changed

+593
-0
lines changed

App.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="Syncfusion.Shared.Wpf" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-17.4460.0.55" newVersion="17.4460.0.55" />
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
14+
</configuration>

App.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application x:Class="WpfApplication1.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
StartupUri="MainWindow.xaml">
5+
<Application.Resources>
6+
7+
</Application.Resources>
8+
</Application>

App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace WpfApplication1
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

MainWindow.xaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Window x:Class="WpfApplication1.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
5+
Title="MainWindow" Height="350" Width="525">
6+
<Grid>
7+
8+
<DockPanel LastChildFill="True">
9+
<Canvas x:Name="canvas" Margin="0,61,0.4,87.8">
10+
<ScrollViewer CanContentScroll="True"
11+
HorizontalScrollBarVisibility="Auto"
12+
VerticalScrollBarVisibility="Auto"
13+
Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}">
14+
<syncfusion:GridControl Name="grid" Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}" />
15+
</ScrollViewer>
16+
</Canvas>
17+
</DockPanel>
18+
</Grid>
19+
</Window>

MainWindow.xaml.cs

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
using Syncfusion.Windows.Controls.Cells;
2+
using Syncfusion.Windows.Controls.Grid;
3+
using Syncfusion.Windows.Controls.Scroll;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows;
10+
using System.Windows.Controls;
11+
using System.Windows.Data;
12+
using System.Windows.Documents;
13+
using System.Windows.Input;
14+
using System.Windows.Media;
15+
using System.Windows.Media.Imaging;
16+
using System.Windows.Navigation;
17+
using System.Windows.Shapes;
18+
19+
namespace WpfApplication1
20+
{
21+
/// <summary>
22+
/// Interaction logic for MainWindow.xaml
23+
/// </summary>
24+
public partial class MainWindow : Window
25+
{
26+
27+
public MainWindow()
28+
{
29+
InitializeComponent();
30+
configureGrid();
31+
}
32+
33+
34+
// Help Functions
35+
private void configureGrid()
36+
{
37+
// Setting the number of rows and columns.
38+
grid.Model.RowCount = 10;
39+
grid.Model.ColumnCount = 10;
40+
// Setting the width and height of the cells.
41+
grid.Model.RowHeights.DefaultLineSize = 50;
42+
grid.Model.ColumnWidths.DefaultLineSize = 50;
43+
44+
// Configuring headers
45+
configureHeaders();
46+
grid.SizeChanged += grid_SizeChanged;
47+
grid.Model.QueryCellInfo += Model_QueryCellInfo;
48+
49+
}
50+
51+
void grid_SizeChanged(object sender, SizeChangedEventArgs e)
52+
{
53+
54+
double width = (e.NewSize.Width - grid.Model.ColumnWidths.DefaultLineSize - 1) / (grid.Model.ColumnCount - 1);
55+
double height = (e.NewSize.Height - grid.Model.RowHeights.DefaultLineSize - 1) / (grid.Model.RowCount - 1);
56+
for (int i = 1; i < grid.Model.ColumnCount; ++i)
57+
grid.Model.ColumnWidths[i] = width;
58+
for (int j = 1; j < grid.Model.RowCount; ++j)
59+
grid.Model.RowHeights[j] = height;
60+
61+
}
62+
63+
void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
64+
{
65+
66+
if (e.Cell.RowIndex == 0 && e.Cell.ColumnIndex > 0)
67+
{
68+
e.Style.Text = GridRangeInfo.GetAlphaLabel(e.Cell.ColumnIndex);
69+
e.Style.HorizontalAlignment = HorizontalAlignment.Center;
70+
e.Style.VerticalAlignment = VerticalAlignment.Center;
71+
}
72+
else if (e.Cell.RowIndex > 0 && e.Cell.ColumnIndex == 0)
73+
{
74+
e.Style.Text = e.Cell.RowIndex.ToString();
75+
e.Style.HorizontalAlignment = HorizontalAlignment.Center;
76+
e.Style.VerticalAlignment = VerticalAlignment.Center;
77+
}
78+
}
79+
80+
81+
82+
83+
private void configureHeaders()
84+
{
85+
grid.Model.RowHeights[0] = 25;
86+
grid.Model.ColumnWidths[0] = 25;
87+
grid.Model.HeaderStyle.Background = new SolidColorBrush(Colors.NavajoWhite);
88+
}
89+
90+
91+
92+
93+
}
94+
}

Properties/AssemblyInfo.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("WpfApplication1")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("WpfApplication1")]
15+
[assembly: AssemblyCopyright("Copyright © 2016")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

Properties/Resources.Designer.cs

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)