Linked Questions

1 vote
2 answers
4k views

C# WPF DataGrid - DateTime formatting [duplicate]

I'm using a DataTable (created in code), and I display it's DefaultView using a DataGrid. The DataTable contains a DataColumn that has DateTime as it's DataType. The DataGrid displays dates as: 10/9/...
Njubster's user avatar
14 votes
3 answers
9k views

DateTime Not showing with currentculture format in Datagrid,ListView

In WPF I am trying to Bind a date property in a DataGrid and I can only sort if it's bound to a DateTime property. The application should show the date in a format corresponding to the user's Region ...
crazy9's user avatar
  • 377
9 votes
2 answers
4k views

How to show just the date and not date and time in a WPF datagrid?

I have a WPF datagrid with a binding to a class object that looks like the following: <DataGridTextColumn Header="Order Date" Binding="{Binding OrderDate }" /> The property in the class is ...
Michael A's user avatar
  • 9,700
1 vote
4 answers
7k views

What's the correct SQL query to retrieve date field without time? C# MS Access

I have a Microsoft Access Database with a Date column listing dates in the format MM/DD/YYYY. I'm using the query : SELECT Date FROM Table This returns the date in C# in the format MM/DD/YYYY HH:MM:...
Hermes's user avatar
  • 17
1 vote
2 answers
700 views

DateTime format changing when used as DataGrid ItemSource

I have a class which has two properties, a string and DateTime. The DateTime property is assigned a value in the constructor: this._lastCheckIn = DateTime.Parse(lastCheckIn.ToString("dd/MM/yyyy HH:mm"...
mike's user avatar
  • 2,153
0 votes
1 answer
317 views

WPF Datagrid Column showing a time

I got a database and a WPF form where I can display the data (and adapt it). The problem is: if I want to adapt the column containing a time it looks like 06.00:00:00:00:00..... which leads to an ...
BirnBaumBlüte's user avatar
1 vote
1 answer
221 views

DataGrid Shows DateTime when i import DATE value from MySql

In my WPF application i have a DataGrid that display a table from MySql database the columns are type DATE but when I fill the dataGrid it shows me DateTime (the value in the table and 12:00:00). ...
klaus's user avatar
  • 159
1 vote
3 answers
128 views

Error while converting string to datetime in c#

I have a DateTime, i'm trying to convert it to string, then convert it back to DateTime to format it. But i keep getting "string isn't recognized as valid datetime string". Any ideas? var ...
Matthew Almeida's user avatar
0 votes
1 answer
237 views

How to edit datetime column in a dataset?

My dataset has column ' START_DATE' and its in datetime format. this is what i tried so far. foreach (DataRow dR in codeDs.Tables[0].Rows) { var def_startDate = Convert.ToDateTime(dR["...
Wymo Oo's user avatar
  • 45
0 votes
2 answers
68 views

Strange Auto-Date Format Datagrid

I got this XAML for my Datagrid Column: <DataGridTemplateColumn SortMemberPath="LiefDat" Width="110" x:Name="columnLieferDatum" > <DataGridTemplateColumn....
Jul Pod's user avatar
  • 356
0 votes
1 answer
69 views

C# disable autoformatting in SqlDataReader

I'm using SqlConnection, MySqlConnection and OracleConnection in WPF to get content of tables in databases. When I try to get the output from the table, everything works perfectly. But if any of the ...
Petr Nečas's user avatar