Showing date in MM/DD/YY format in a gridview column from .cs page/rowdatabound?
问题 I am getting a date time field from database with timestamp. My grid has an auto-generated column. I am formatting it in my .cs page dsWorkItems.Tables[0].Rows[count]["Date"] = !string.IsNullOrEmpty(dsWorkItems.Tables[0].Rows[count]["Date"].ToString()) ? ((DateTime)(dsWorkItems.Tables[0].Rows[count]["Date"])).ToShortDateString(): ""; In quick watch I am getting ((DateTime)(dsWorkItems.Tables[0].Rows[count]["Date"])).ToShortDateString() as 9/26/2013 but in grid I am getting 9/26/2013 12:00:00