Skip to content

Commit

Permalink
Merge pull request #1 from kanimozhi-b/master
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
PiruthivirajM authored Mar 17, 2020
2 parents 29fb311 + b522f06 commit 662fc20
Show file tree
Hide file tree
Showing 13 changed files with 593 additions and 0 deletions.
14 changes: 14 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Shared.Wpf" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-17.4460.0.55" newVersion="17.4460.0.55" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
8 changes: 8 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfApplication1
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
19 changes: 19 additions & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="MainWindow" Height="350" Width="525">
<Grid>

<DockPanel LastChildFill="True">
<Canvas x:Name="canvas" Margin="0,61,0.4,87.8">
<ScrollViewer CanContentScroll="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}">
<syncfusion:GridControl Name="grid" Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}" />
</ScrollViewer>
</Canvas>
</DockPanel>
</Grid>
</Window>
94 changes: 94 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
using Syncfusion.Windows.Controls.Cells;
using Syncfusion.Windows.Controls.Grid;
using Syncfusion.Windows.Controls.Scroll;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{

public MainWindow()
{
InitializeComponent();
configureGrid();
}


// Help Functions
private void configureGrid()
{
// Setting the number of rows and columns.
grid.Model.RowCount = 10;
grid.Model.ColumnCount = 10;
// Setting the width and height of the cells.
grid.Model.RowHeights.DefaultLineSize = 50;
grid.Model.ColumnWidths.DefaultLineSize = 50;

// Configuring headers
configureHeaders();
grid.SizeChanged += grid_SizeChanged;
grid.Model.QueryCellInfo += Model_QueryCellInfo;

}

void grid_SizeChanged(object sender, SizeChangedEventArgs e)
{

double width = (e.NewSize.Width - grid.Model.ColumnWidths.DefaultLineSize - 1) / (grid.Model.ColumnCount - 1);
double height = (e.NewSize.Height - grid.Model.RowHeights.DefaultLineSize - 1) / (grid.Model.RowCount - 1);
for (int i = 1; i < grid.Model.ColumnCount; ++i)
grid.Model.ColumnWidths[i] = width;
for (int j = 1; j < grid.Model.RowCount; ++j)
grid.Model.RowHeights[j] = height;

}

void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
{

if (e.Cell.RowIndex == 0 && e.Cell.ColumnIndex > 0)
{
e.Style.Text = GridRangeInfo.GetAlphaLabel(e.Cell.ColumnIndex);
e.Style.HorizontalAlignment = HorizontalAlignment.Center;
e.Style.VerticalAlignment = VerticalAlignment.Center;
}
else if (e.Cell.RowIndex > 0 && e.Cell.ColumnIndex == 0)
{
e.Style.Text = e.Cell.RowIndex.ToString();
e.Style.HorizontalAlignment = HorizontalAlignment.Center;
e.Style.VerticalAlignment = VerticalAlignment.Center;
}
}




private void configureHeaders()
{
grid.Model.RowHeights[0] = 25;
grid.Model.ColumnWidths[0] = 25;
grid.Model.HeaderStyle.Background = new SolidColorBrush(Colors.NavajoWhite);
}




}
}
55 changes: 55 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// 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("WpfApplication1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WpfApplication1")]
[assembly: AssemblyCopyright("Copyright © 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)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// 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")]
71 changes: 71 additions & 0 deletions Properties/Resources.Designer.cs

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

Loading

0 comments on commit 662fc20

Please sign in to comment.