Skip to content

Commit f3dcb9b

Browse files
ES-857662 - Sample level changes committed.
1 parent 0a97d40 commit f3dcb9b

12 files changed

Lines changed: 302 additions & 262 deletions
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
33
<startup>
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
55
</startup>
6-
<runtime>
7-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8-
<dependentAssembly>
9-
<assemblyIdentity name="Syncfusion.Data.WPF" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
10-
<bindingRedirect oldVersion="0.0.0.0-24.1460.29.0" newVersion="24.1460.29.0" />
11-
</dependentAssembly>
12-
</assemblyBinding>
13-
</runtime>
146
</configuration>

DisplayRowIndexinRowheadercell/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Application x:Class="DisplayRowIndexinRowheadercell.App"
1+
<Application x:Class="DisplayRowIndexInGridRowHeaderCell.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:DisplayRowIndexinRowheadercell"
4+
xmlns:local="clr-namespace:DisplayRowIndexInGridRowHeaderCell"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
77

DisplayRowIndexinRowheadercell/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Threading.Tasks;
77
using System.Windows;
88

9-
namespace DisplayRowIndexinRowheadercell
9+
namespace DisplayRowIndexInGridRowHeaderCell
1010
{
1111
/// <summary>
1212
/// Interaction logic for App.xaml
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using Microsoft.Xaml.Behaviors;
2+
using Syncfusion.UI.Xaml.Controls.DataPager;
3+
using Syncfusion.UI.Xaml.Grid;
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+
12+
namespace DisplayRowIndexInGridRowHeaderCell
13+
{
14+
internal class WindowBehavior : Behavior<Window>
15+
{
16+
17+
SfDataPager dataPager;
18+
SfDataGrid dataGrid;
19+
protected override void OnAttached()
20+
{
21+
base.OnAttached();
22+
var window = this.AssociatedObject as Window;
23+
dataGrid = window.FindName("dataGrid") as SfDataGrid;
24+
dataPager = window.FindName("dataPager") as SfDataPager;
25+
dataPager.PageIndexChanged += OnPageIndexChanged;
26+
}
27+
28+
private void OnPageIndexChanged(object sender, PageIndexChangedEventArgs e)
29+
{
30+
for (int i = 1; i < dataGrid.RowGenerator.Items.Count; i++)
31+
{
32+
var rowHeaderCell = ((dataGrid.RowGenerator.Items[i] as DataRow).VisibleColumns[0] as DataColumn).ColumnElement;
33+
(rowHeaderCell as GridRowHeaderCell).RowIndex = -1;
34+
}
35+
}
36+
37+
protected override void OnDetaching()
38+
{
39+
dataPager.PageIndexChanged -= OnPageIndexChanged;
40+
base.OnDetaching();
41+
}
42+
}
43+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Syncfusion.UI.Xaml.Controls.DataPager;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Globalization;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
using System.Windows.Data;
9+
10+
namespace DisplayRowIndexInGridRowHeaderCell
11+
{
12+
public class RowIndexConverter : IMultiValueConverter
13+
{
14+
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
15+
{
16+
var dataPager = values[2] as SfDataPager;
17+
18+
if (dataPager.PageIndex == 0 || (int)values[0] == -1)
19+
{
20+
return values[0].ToString();
21+
}
22+
23+
values[0] = (int)values[0] + (((dataPager.PageIndex + 1) - 1) * dataPager.PageSize);
24+
return values[0].ToString();
25+
26+
}
27+
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
28+
{
29+
throw new NotImplementedException();
30+
}
31+
}
32+
}

DisplayRowIndexinRowheadercell/DisplayRowIndexinRowheadercell.csproj renamed to DisplayRowIndexinRowheadercell/DisplayRowIndexInGridRowHeaderCell.csproj

Lines changed: 108 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,109 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{73B73DCA-91FF-40D9-97D0-E37221C16C62}</ProjectGuid>
8-
<OutputType>WinExe</OutputType>
9-
<RootNamespace>DisplayRowIndexinRowheadercell</RootNamespace>
10-
<AssemblyName>DisplayRowIndexinRowheadercell</AssemblyName>
11-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14-
<WarningLevel>4</WarningLevel>
15-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16-
<Deterministic>true</Deterministic>
17-
</PropertyGroup>
18-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19-
<PlatformTarget>AnyCPU</PlatformTarget>
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
23-
<OutputPath>bin\Debug\</OutputPath>
24-
<DefineConstants>DEBUG;TRACE</DefineConstants>
25-
<ErrorReport>prompt</ErrorReport>
26-
<WarningLevel>4</WarningLevel>
27-
</PropertyGroup>
28-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29-
<PlatformTarget>AnyCPU</PlatformTarget>
30-
<DebugType>pdbonly</DebugType>
31-
<Optimize>true</Optimize>
32-
<OutputPath>bin\Release\</OutputPath>
33-
<DefineConstants>TRACE</DefineConstants>
34-
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>4</WarningLevel>
36-
</PropertyGroup>
37-
<ItemGroup>
38-
<Reference Include="Syncfusion.Data.WPF, Version=24.1460.29.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
39-
<HintPath>packages\Syncfusion.Data.WPF.24.1.29\lib\net46\Syncfusion.Data.WPF.dll</HintPath>
40-
</Reference>
41-
<Reference Include="Syncfusion.Licensing, Version=23.2460.5.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
42-
<HintPath>packages\Syncfusion.Licensing.23.2.5\lib\net46\Syncfusion.Licensing.dll</HintPath>
43-
</Reference>
44-
<Reference Include="Syncfusion.SfGrid.WPF, Version=23.2460.5.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
45-
<HintPath>packages\Syncfusion.SfGrid.WPF.23.2.5\lib\net46\Syncfusion.SfGrid.WPF.dll</HintPath>
46-
</Reference>
47-
<Reference Include="Syncfusion.Shared.WPF, Version=23.2460.5.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
48-
<HintPath>packages\Syncfusion.Shared.WPF.23.2.5\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
49-
</Reference>
50-
<Reference Include="System" />
51-
<Reference Include="System.Data" />
52-
<Reference Include="System.Xml" />
53-
<Reference Include="Microsoft.CSharp" />
54-
<Reference Include="System.Core" />
55-
<Reference Include="System.Xml.Linq" />
56-
<Reference Include="System.Data.DataSetExtensions" />
57-
<Reference Include="System.Net.Http" />
58-
<Reference Include="System.Xaml">
59-
<RequiredTargetFramework>4.0</RequiredTargetFramework>
60-
</Reference>
61-
<Reference Include="WindowsBase" />
62-
<Reference Include="PresentationCore" />
63-
<Reference Include="PresentationFramework" />
64-
</ItemGroup>
65-
<ItemGroup>
66-
<ApplicationDefinition Include="App.xaml">
67-
<Generator>MSBuild:Compile</Generator>
68-
<SubType>Designer</SubType>
69-
</ApplicationDefinition>
70-
<Compile Include="ViewModel\OrderInfoViewModel.cs" />
71-
<Page Include="MainWindow.xaml">
72-
<Generator>MSBuild:Compile</Generator>
73-
<SubType>Designer</SubType>
74-
</Page>
75-
<Compile Include="App.xaml.cs">
76-
<DependentUpon>App.xaml</DependentUpon>
77-
<SubType>Code</SubType>
78-
</Compile>
79-
<Compile Include="MainWindow.xaml.cs">
80-
<DependentUpon>MainWindow.xaml</DependentUpon>
81-
<SubType>Code</SubType>
82-
</Compile>
83-
</ItemGroup>
84-
<ItemGroup>
85-
<Compile Include="Model\OrderInfo.cs" />
86-
<Compile Include="Properties\AssemblyInfo.cs">
87-
<SubType>Code</SubType>
88-
</Compile>
89-
<Compile Include="Properties\Resources.Designer.cs">
90-
<AutoGen>True</AutoGen>
91-
<DesignTime>True</DesignTime>
92-
<DependentUpon>Resources.resx</DependentUpon>
93-
</Compile>
94-
<Compile Include="Properties\Settings.Designer.cs">
95-
<AutoGen>True</AutoGen>
96-
<DependentUpon>Settings.settings</DependentUpon>
97-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
98-
</Compile>
99-
<EmbeddedResource Include="Properties\Resources.resx">
100-
<Generator>ResXFileCodeGenerator</Generator>
101-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
102-
</EmbeddedResource>
103-
<None Include="packages.config" />
104-
<None Include="Properties\Settings.settings">
105-
<Generator>SettingsSingleFileGenerator</Generator>
106-
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
107-
</None>
108-
</ItemGroup>
109-
<ItemGroup>
110-
<None Include="App.config" />
111-
</ItemGroup>
112-
<ItemGroup />
113-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>DisplayRowIndexInGridRowHeaderCell</RootNamespace>
10+
<AssemblyName>DisplayRowIndexInGridRowHeaderCell</AssemblyName>
11+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
39+
<HintPath>packages\Microsoft.Xaml.Behaviors.Wpf.1.0.1\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Syncfusion.Data.WPF" />
42+
<Reference Include="Syncfusion.SfGrid.WPF" />
43+
<Reference Include="Syncfusion.Shared.WPF" />
44+
<Reference Include="System" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Xml" />
47+
<Reference Include="Microsoft.CSharp" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Xml.Linq" />
50+
<Reference Include="System.Data.DataSetExtensions" />
51+
<Reference Include="System.Net.Http" />
52+
<Reference Include="System.Xaml">
53+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
54+
</Reference>
55+
<Reference Include="WindowsBase" />
56+
<Reference Include="PresentationCore" />
57+
<Reference Include="PresentationFramework" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<ApplicationDefinition Include="App.xaml">
61+
<Generator>MSBuild:Compile</Generator>
62+
<SubType>Designer</SubType>
63+
</ApplicationDefinition>
64+
<Compile Include="Behavior\WindowBehavior.cs" />
65+
<Compile Include="Converter\RowIndexConverter.cs" />
66+
<Compile Include="ViewModel\ViewModel.cs" />
67+
<Page Include="MainWindow.xaml">
68+
<Generator>MSBuild:Compile</Generator>
69+
<SubType>Designer</SubType>
70+
</Page>
71+
<Compile Include="App.xaml.cs">
72+
<DependentUpon>App.xaml</DependentUpon>
73+
<SubType>Code</SubType>
74+
</Compile>
75+
<Compile Include="MainWindow.xaml.cs">
76+
<DependentUpon>MainWindow.xaml</DependentUpon>
77+
<SubType>Code</SubType>
78+
</Compile>
79+
</ItemGroup>
80+
<ItemGroup>
81+
<Compile Include="Model\OrderInfo.cs" />
82+
<Compile Include="Properties\AssemblyInfo.cs">
83+
<SubType>Code</SubType>
84+
</Compile>
85+
<Compile Include="Properties\Resources.Designer.cs">
86+
<AutoGen>True</AutoGen>
87+
<DesignTime>True</DesignTime>
88+
<DependentUpon>Resources.resx</DependentUpon>
89+
</Compile>
90+
<Compile Include="Properties\Settings.Designer.cs">
91+
<AutoGen>True</AutoGen>
92+
<DependentUpon>Settings.settings</DependentUpon>
93+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
94+
</Compile>
95+
<EmbeddedResource Include="Properties\Resources.resx">
96+
<Generator>ResXFileCodeGenerator</Generator>
97+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
98+
</EmbeddedResource>
99+
<None Include="packages.config" />
100+
<None Include="Properties\Settings.settings">
101+
<Generator>SettingsSingleFileGenerator</Generator>
102+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
103+
</None>
104+
</ItemGroup>
105+
<ItemGroup>
106+
<None Include="App.config" />
107+
</ItemGroup>
108+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114109
</Project>

DisplayRowIndexinRowheadercell/DisplayRowIndexinRowheadercell.sln renamed to DisplayRowIndexinRowheadercell/DisplayRowIndexInGridRowHeaderCell.sln

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.7.34009.444
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisplayRowIndexinRowheadercell", "DisplayRowIndexinRowheadercell.csproj", "{73B73DCA-91FF-40D9-97D0-E37221C16C62}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{73B73DCA-91FF-40D9-97D0-E37221C16C62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{73B73DCA-91FF-40D9-97D0-E37221C16C62}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{73B73DCA-91FF-40D9-97D0-E37221C16C62}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{73B73DCA-91FF-40D9-97D0-E37221C16C62}.Release|Any CPU.Build.0 = Release|Any CPU
18-
EndGlobalSection
19-
GlobalSection(SolutionProperties) = preSolution
20-
HideSolutionNode = FALSE
21-
EndGlobalSection
22-
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {89303195-327C-4C6A-BB87-69B5E404B72E}
24-
EndGlobalSection
25-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.7.34221.43
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisplayRowIndexInGridRowHeaderCell", "DisplayRowIndexInGridRowHeaderCell.csproj", "{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{212CC225-D3A4-4CED-B9AC-9CF1C1593B89}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {96607B63-364F-4226-87AC-8EF591EB2565}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)