When transfering a table from a database to a datagrid (WPF), the DATE datatype from T-SQL is converted to DateTime, but I don't want that. I want only the .Date part to show up in my datagrid.
Here's the piece of code in c#:
cmd = new SqlCommand("SELECT * FROM bibliotvguia.get_progtv();", con);
adap = new SqlDataAdapter(cmd);
dt = new DataTable();
adap.Fill(dt);
programs_datagrid.ItemsSource = dt.DefaultView;
And the XAML piece of code:
<DataGrid SelectionMode="Single" Name="programs_datagrid" Height="340"
AutoGenerateColumns="False" RowHeaderWidth="0" IsReadOnly="True" CanUserResizeColumns="True"
CanUserReorderColumns="False">
<DataGrid.Columns >
<DataGridTextColumn Header="Canal de TV" Binding="{Binding canal_media}"></DataGridTextColumn>
<DataGridTextColumn Header="Dia" Binding="{Binding dia_media}"></DataGridTextColumn>
<DataGridTextColumn Header="Hora" Binding="{Binding hora_media}"></DataGridTextColumn>
<DataGridTextColumn Header="Produção Audiovisual" Binding="{Binding titulo}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
The dia_media column is the one that has a DateTime type.
Thanks for your help.
The best for you.

DATEcolumn type is for datetimes. Why don't you want this? If you want to show only.Dateproperty, then you can bound their.Dateproperties to your datagrid. Of you can use"d"standart pattern. What isbibliotvguia.get_progtv()for exactly by the way?