Click here to Skip to main content
15,941,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want bind WPF datagrid by dataset.Please Write me the proper C# code.

1 solution


Try the following

<DataGrid Height="500" Width="750" Canvas.Left="37" Canvas.Top="41" x:Name="dgTest" ItemsSource="{Binding}">
                            <CheckBox x:Name="Test" Visibility="{Binding Path=Flag,Converter={StaticResource boolToVis}}"></CheckBox>




Code Behind:

DataView dv = dsEmp.Tables[0].DefaultView;
            dgTest.DataContext = dv;
            dv.AllowNew = false;

Hope this helps...
Share this answer

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