SfDataGrid allows you to set the ContextMenus for Headers, Records, GroupCaption, GroupDropArea, GroupDropItem, GroupSummary, and TableSummary. Menu collections are bounded as ItemSource for ContextMenu with the ItemSource property binding. Refer the following code sample, XAML
Here, MenuList property can be accessed from ViewModel by setting StaticResource. ContextMenu for Header is set using SfDataGrid.HeaderContextMenu. Similarly ContextMenu can be set for Records, GroupCaption, GroupDropArea, GroupDropItem, GroupSummary, and TableSummary. The following screenshot shows the ContextMenu of Header,
You can refer to the sample from the following location. Sample Link: WPF
|
Article ID: | Published Date: | Last Revised Date: | Platform: | Control: | .NET Framework: | Product Version: |
2430 | 08/06/2014 | 03/28/2017 | WPF | SfDataGrid | 4 | 11.4.0.26 |
Tags:
|
Naushad Dowlut | May 31, 2016 |
More helpful if sample showed how to bind the menu items to commands. | |
Sivakumar R [Syncfusion] | Jul 20, 2016 |
Please refer the below kb which shows binding menu items to commands. Kb Link: https://www.syncfusion.com/kb/3245/how-to-copy-the-column-and-paste-it-as-a-new-column-by-contextmenu-in-sfdatagrid | |
or the page will be automatically redirected to sign-in page in 10 seconds.