Witam. W kodzie programu mam wypełnioną klasę dataset, jak mogę ją załadować do datagrid? Wiem że to działa poprawnie jak dataset wypełnię z bazy danych MySQl za pomocą tej linijki
adp.Fill(ds, "LoadDataBinding");
Ale jak to wyświetlić teraz bez tej linii?
Wygląd kodu mojego datagrid
<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="00,20,0,0" Name="dataGridCustomers" ItemsSource="{Binding Path=LoadDataBinding}" CanUserResizeRows="False" AlternatingRowBackground="LightGreen" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=ID}" Header="Id" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=TICKET}" Header="Ticket" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=COMPANY}" Header="Company" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=DATE_START}" Header="Date Start" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=GROOUP}" Header="Group" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=DATE_STOP}" Header="Date Stop" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=PRIORITY}" Header="Priority" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=WORKER_CREATE}" Header="Worker Create" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=WORKER_CLOSE}" Header="Worker Close" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=TYPE}" Header="Type" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=TOPIC}" Header="Topic" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
<DataGridTextColumn Binding="{Binding Path=DESCRIPTION}" Header="Desrciption" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=ActualWidth}" />
</DataGrid.Columns>
</DataGrid>