Articles in this section
Category / Section

How to resolve the Copy paste issue in WinForms GridGroupingControl when the startup projects is in WPF?

1 min read

Resolve the copy paste issue

According to Windows Forms, can’t perform the copy paste options in GridGroupingControl when the startup project is in WPF. While opening the Windows Forms form from the WPF window, the keyboard messages does not pass to the WPF window.  Add the EnableWindowsFormsInterop() method in Startup event to enable the copy paste option.

<Application x:Class="AutoHideDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
StartupUri="Window1.xaml" Startup="Application_Startup" >

To enable the Windows Forms copy, paste options, when the Startup project is WPF.

C#

private void Application_Startup(object sender, StartupEventArgs e)
{
   WindowsFormsHost.EnableWindowsFormsInterop();
}

VB

Private Sub Application_Startup(ByVal sender As Object, ByVal e As StartupEventArgs)
   WindowsFormsHost.EnableWindowsFormsInterop()
End Sub

Show the copy paste value

Samples:

C#: Copy paste

VB: Copy paste

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied