Skip to content

Commit b156275

Browse files
Sample for changing the orientation of column header in wpf treegrid is included.
1 parent 354a89e commit b156275

17 files changed

+1216
-0
lines changed

SfTreeGridDemo.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SfTreeGridDemo", "SfTreeGridDemo\SfTreeGridDemo.csproj", "{E17FB357-7AC5-4B42-8818-786FD824B536}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
Release-XML|Any CPU = Release-XML|Any CPU
13+
EndGlobalSection
14+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Release-XML|Any CPU.ActiveCfg = Release|Any CPU
20+
{E17FB357-7AC5-4B42-8818-786FD824B536}.Release-XML|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
GlobalSection(SolutionProperties) = preSolution
23+
HideSolutionNode = FALSE
24+
EndGlobalSection
25+
EndGlobal

SfTreeGridDemo/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
5+
</startup>
6+
</configuration>

SfTreeGridDemo/App.xaml

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

SfTreeGridDemo/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 SfTreeGridDemo
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

SfTreeGridDemo/Behavior.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Syncfusion.UI.Xaml.TreeGrid;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Controls;
8+
using System.Windows.Interactivity;
9+
using Syncfusion.UI.Xaml.TreeGrid;
10+
using System.Windows;
11+
using Syncfusion.Data;
12+
13+
namespace SfTreeGridDemo
14+
{
15+
class Behavior:Behavior<MainWindow>
16+
{
17+
protected override void OnAttached()
18+
{
19+
base.OnAttached();
20+
}
21+
}
22+
}

SfTreeGridDemo/Converter.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Globalization;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Data;
8+
9+
namespace SfTreeGridDemo
10+
{
11+
public class MultiCommandConverter : IMultiValueConverter
12+
{
13+
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
14+
{
15+
return values.ToList();
16+
}
17+
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
18+
{
19+
return null;
20+
}
21+
}
22+
}

SfTreeGridDemo/Helper.cs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Controls;
8+
using System.Windows.Input;
9+
10+
namespace SfTreeGridDemo
11+
{
12+
public class BaseCommand : ICommand
13+
{
14+
#region Fields
15+
16+
readonly Action<object> _execute;
17+
readonly Predicate<object> _canExecute;
18+
19+
20+
#endregion // Fields
21+
22+
#region Constructors
23+
24+
public BaseCommand(Action<object> execute)
25+
: this(execute, null)
26+
{
27+
}
28+
29+
public BaseCommand(Action<object> execute, Predicate<object> canExecute)
30+
{
31+
if (execute == null)
32+
throw new ArgumentNullException("execute");
33+
34+
_execute = execute;
35+
_canExecute = canExecute;
36+
}
37+
38+
39+
40+
#endregion // Constructors
41+
42+
#region ICommand Members
43+
44+
public bool CanExecute(object parameter)
45+
{
46+
return _canExecute == null ? true : _canExecute(parameter);
47+
}
48+
49+
public event EventHandler CanExecuteChanged
50+
{
51+
add { CommandManager.RequerySuggested += value; }
52+
remove { CommandManager.RequerySuggested -= value; }
53+
}
54+
55+
public void Execute(object parameter)
56+
{
57+
_execute(parameter);
58+
}
59+
60+
#endregion // ICommand Members
61+
}
62+
}

0 commit comments

Comments
 (0)