Hi i want to add the result of sql query to datagrid in my WPF application. I use SQL to LINQ to fetch data.Please help me.
1 Answer
Just Set the ItemSource property of the DataGrid to the value of the result of that query using C# :
dataGrid1.ItemSource = query ;
ensure you set the AutoGenerateColumns property into true in XAML
<DataGrid x:Name="dataGrid1"
AutoGenerateColumns="True" />
1 Comment
Viraj Dhamal
what to do in case when i use grid control , <Grid Height="341" Name="grid1" Width="833" > </Grid>