Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reformatting a column in a DataGridView

Status
Not open for further replies.

DayLaborer

Programmer
Jan 3, 2006
347
0
0
US
I have a column in a DataGridView:[tt]
dgvEmpSearchResults.Columns["StartDate"][/tt]

which is displaying:[tt]
10/30/2009 12:00:00 AM[/tt]

but I just want it to display in ShortDate format. The DataGridView is bound to a (list) DataSource. How can I change the display format of the dates in this column?

Thanks!
Eliezer
 
Are you building the columns in the codebehind or in ASP.NET? Look into using the DefaultCellStyle property of the columns before the databind.

[morning]


"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top