Separator in Header Context or Context Menu?
Hi,
please look at your samples here: https://help.syncfusion.com/wpf/datagrid/context-menu
All the screenshots show a separator, while the code doesn't.
When adding a Headercontext menu or a SfDataGrid.ContextMenu with 18.3 i get on right-click:
System.InvalidOperationException: 'A style intended for type 'MenuItem' cannot be applied to type 'Separator'.'
Code Snippet:
<syncfusion:SfDataGrid.ContextMenu>
<ContextMenu>
<MenuItem Header="Item1" >
</MenuItem>
<Separator/>
<MenuItem Header="Item2" >
</MenuItem>
</ContextMenu>
</syncfusion:SfDataGrid.ContextMenu>
Removing the Separator it works.
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
VS
Vijayarasan Sivanandham
Syncfusion Team
November 25, 2020 01:32 PM UTC
Hi Helmut Wahrmann,
Thank you for contacting Syncfusion support.
Based on provided information we have checked the reported issue “Separator in Header Context or Context Menu” and unable to replicate the issue from our end. it is working fine as expected. Please find the tested sample and video demo from our end in the below link,
Sample link: https://www.syncfusion.com/downloads/support/forum/160021/ze/ContextMenuwithSeparator1801331212
We have checked with Syncfusion product version 18.3.0.35.
Can you please share us below things?
1. Brief replication procedure/video illustration of the reported issue
2. Code snippet related customization in SfDataGrid?
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Can you please share us below things?
1. Brief replication procedure/video illustration of the reported issue
2. Code snippet related customization in SfDataGrid?
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Marked as answer
HW
Helmut Wahrmann
November 26, 2020 02:26 PM UTC
Hi Vijayarasan S,
Attachment: SongGridView.xaml_4ffc11a3.zip
sure. while trying to record this i noticed that in some starts it works and others it fails.
So out of 10 starts it fails 6 times and it works 4 times.
i removed the separator from the Header Context and left it in the context menu of the grid itself.
the attached video shows it failing, when i did a right click in the grid after startup.
then i started again and now it worked.
Also attached the xaml file with my definitions.
regards,
Helmut
Attachment: SongGridView.xaml_4ffc11a3.zip
HW
Helmut Wahrmann
November 26, 2020 02:27 PM UTC
HW
Helmut Wahrmann
November 26, 2020 03:17 PM UTC
Found a pattern.
It NEVER crashes if i open te Header Context Menu, without the separators, first.
it ALWAYS crashes, if i open the Grid Context Menu first, without opening the Header Context.
Nevermind: Fixed it by defining my own style for Menuitem and separator
VS
Vijayarasan Sivanandham
Syncfusion Team
November 27, 2020 07:41 AM UTC
Hi Helmut Wahrmann,
Thanks for the update.
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
HW Helmut Wahrmann
- Nov 24, 2020 07:14 PM UTC
- Nov 27, 2020 07:41 AM UTC