C
cindy
I have a datatable with column datetime datatype from sql
I c# datagrid on webform with bound column to display values
I need to sort on values.
I sql the field value is a string so I make it pass the is string a valid
date test before I dump it into
dc = new DataColumn("reviseddate",Type.GetType("System.DateTime"));
dt.Columns.Add(dc);
the values are all over the place some have times some do not etc.
if not valid I want to assign DBNull to the column but I have not got that
syntax working right either. The datagrid column binds and displays, the
sort expression is the DataField. The only thing right that sort does is put
nulls on top (sort of right)
I guess the datagrid column is not type datetime. All day nowhere can I
find syntax for setting this bound column datatype. It is not dynamically
built, I have tried using with template column where is the property says
datagrid1.column whatever datatype = datetime. I guess if I could do that
then using DataFormatString="{0:d}" to make ugly datetime in short date
display would work or would it because DataFormatString="{0:d}" only works
for bound column.
Please why so hard?
Yes users have date and date with time strings in sql
But I do check the string is valid date
I put into datatable with column datatype datetime would ya think the
datagrid would hold on to datatype?
datatable columI tried just do sort with values in that ugly datetime
sql you know.
User entries to sql database pass the is it a date test but they have all
kinds o
I c# datagrid on webform with bound column to display values
I need to sort on values.
I sql the field value is a string so I make it pass the is string a valid
date test before I dump it into
dc = new DataColumn("reviseddate",Type.GetType("System.DateTime"));
dt.Columns.Add(dc);
the values are all over the place some have times some do not etc.
if not valid I want to assign DBNull to the column but I have not got that
syntax working right either. The datagrid column binds and displays, the
sort expression is the DataField. The only thing right that sort does is put
nulls on top (sort of right)
I guess the datagrid column is not type datetime. All day nowhere can I
find syntax for setting this bound column datatype. It is not dynamically
built, I have tried using with template column where is the property says
datagrid1.column whatever datatype = datetime. I guess if I could do that
then using DataFormatString="{0:d}" to make ugly datetime in short date
display would work or would it because DataFormatString="{0:d}" only works
for bound column.
Please why so hard?
Yes users have date and date with time strings in sql
But I do check the string is valid date
I put into datatable with column datatype datetime would ya think the
datagrid would hold on to datatype?
datatable columI tried just do sort with values in that ugly datetime
sql you know.
User entries to sql database pass the is it a date test but they have all
kinds o