Skip to content

Commit 8e44c3a

Browse files
ES-975464 - Addressed the concerns
1 parent 9b21996 commit 8e44c3a

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

CopyingUsingContextMenu.png

132 KB
Loading

PastingUsingContextMenu.png

114 KB
Loading

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# How to copy a column and paste it as a new column in wpf treegrid
1+
# How to Copy a Column and Paste it as a New Column in WPF TreeGrid?
22

3-
This sample illustrates how to copy a column and paste it as a new column in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid).
3+
This sample illustrates how to copy a column and paste it as a new column in [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) (SfTreeGrid).
44

5-
You can copy a column and paste it into a new position using the context menu option in `TreeGrid`.
5+
You can copy a column and paste it into a new position using the context menu option in TreeGrid.
66

77
### XAML
88

99
``` xml
1010
<syncfusion:SfTreeGrid.HeaderContextMenu>
11-
<ContextMenu ItemsSource="{Binding Menu,Source={StaticResource viewmodel}}" >
12-
<ContextMenu.ItemContainerStyle>
13-
<Style TargetType="MenuItem">
14-
<Setter Property="Command" Value="{Binding MyCommand,Source={StaticResource viewmodel}}"></Setter>
15-
<Setter Property="CommandParameter" >
16-
<Setter.Value>
17-
<MultiBinding Converter="{StaticResource ResourceKey=converter}">
18-
<Binding RelativeSource="{RelativeSource Self}"/>
19-
<Binding />
20-
</MultiBinding>
21-
</Setter.Value>
22-
</Setter>
23-
</Style>
24-
</ContextMenu.ItemContainerStyle>
25-
</ContextMenu>
11+
<ContextMenu ItemsSource="{Binding Menu,Source={StaticResource viewmodel}}" >
12+
<ContextMenu.ItemContainerStyle>
13+
<Style TargetType="MenuItem">
14+
<Setter Property="Command" Value="{Binding MyCommand,Source={StaticResource viewmodel}}">
15+
</Setter>
16+
<Setter Property="CommandParameter" >
17+
<Setter.Value>
18+
<MultiBinding Converter="{StaticResource ResourceKey=converter}">
19+
<Binding RelativeSource="{RelativeSource Self}"/>
20+
<Binding />
21+
</MultiBinding>
22+
</Setter.Value>
23+
</Setter>
24+
</Style>
25+
</ContextMenu.ItemContainerStyle>
26+
</ContextMenu>
2627
</syncfusion:SfTreeGrid.HeaderContextMenu>
2728
```
2829

@@ -49,4 +50,12 @@ private static void OnPasteColumn(object obj)
4950
grid.Columns.Insert(index + 1, new TreeGridTextColumn() { MappingName = CopiedColumn.MappingName });
5051
}
5152
}
52-
```
53+
```
54+
55+
### Copy the ID column using context menu
56+
57+
![Copying the ID column using context menu](CopyingUsingContextMenu.png)
58+
59+
### Paste the ID column after ReportsTo column
60+
61+
![Pasting the ID column using context menu](PastingUsingContextMenu.png)

0 commit comments

Comments
 (0)