Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a WPF User control on which i have a datgrid with grouped data.
I want to use this datagrid on a Windows Form. How i can get the data.
I am using Datasets.
Posted

Add a reference of your WFP library to your windows application.

Using System.Windows.Forms.Integration.ElementHost present in your toolbox you can embed a WPF control in windows form.

You can set the Child property of the ElementHost from the property window or same thing can be done programitacally as followng.

wpfElementHost.Child =  new YoutUserControl();



For setting the the datasource you can expose a property which takes a dataset or you can pass the dataset in the WPF user control constructor itself.
 
Share this answer
 
I Finally figured this out.
thanks !!!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900