3
I have a DataTable
loaded with information in a WPF application.
I’d like to take that DataTable
and carry it on a DataGrid
.
How can I do this the easy way ?
DataGrid
in the XAML:
<Grid>
<Button Content="Pedidos
" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="91" Click="Button_Click" Height="27"/>
<DataGrid Name="dataGrid" HorizontalAlignment="Left" Margin="10,42,0,0" VerticalAlignment="Top" Height="268" Width="558"/>
</Grid>
I believe that when you assign Datagrid, your datatable as Datasource and then a Bind() on it. This causes your Datatable to be transferred to your Datagrid.
– pnet
Can you send me an example code ?
– Emerson Brito