c# - How to change the format of a Date within gridview? -
i'd change date column in gridview dd-mm-yyyy , space time @ end in format of 00:00:00
the name of column thedate , column number 2 i've tried datagridview1[2]["thedate"].tostring("dd/mm/yyyy");
string str = datagridview1[2]["thedate"].tostring("dd.mm.yyyy"); datetime dt = datetime.now; string formated = datagridview1.columns[2].tostring("dd.mm.yyyy"); string formated = string.format("{0:dd.mm.yyyy}", datagridview1.columns[2]);
and none of them work i'm not sure go here!
i think problem
datagridview1[2]["thedate"].tostring("dd.mm.yyyy");
this code not datetime instance.
first convert datagridview1[2]["thedate"]
datetime
use tostring("dd.mm.yyyy");
on it. work.
Comments
Post a Comment