Formatting a column in a Datagridview

C

cameljs18

I have a datagridview but its datasource changes to different
datatable each time i do a search.When a certain table is the
datasource i want all the cells in that column to have three decimals
after the commer eg. #.### how do i do this.
 
R

RobinS

Have you checked out the CellStyle.Format property for that column? For
example, this sets the format for a column to short date:

DataGridViewCellStyle dgvCellStyle = new DataGridViewCellStyle();
dgvCellStyle.Format = "d";
theSpeicficDGVColumn.DefaultCellStyle = dgvCellStyle;


RobinS.
GoldMail, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top