Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > formatting numbers & columns in datagrid

Thread Tools

formatting numbers & columns in datagrid

John Wilson
Posts: n/a
I am still working away to get to grips with .NET web forms. Can anyone help
me with these conundrums?

How do I programmatically control the with of a datagrid itself and the
columns in it? At the moment my grid is wider than the columns, leaving a
spare bit to the right, and yet some of my columns are too narrow. Can I
even get them to adjust automatically, eg to the width of the widest cell

Also, how do I get numeric data to display correctly? The data comes from a
sql query. I want it to display to 2 decimal places even if ".00", but at
the moment I can't get it to give me those extra zeros whatever I do.

I also had a problem figuring out how to right align the columns of figures.
I fiddled with the GUI and managed this, but more by accident than design
and I still don't know how I did it. In any event for future reference I
want to know how to do it programatically.

Has anyone any tips?

John Wilson

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting columns in datagrid using XSD file DaVBGuy ASP .Net Datagrid Control 0 04-27-2005 07:55 PM
Binded Datagrid Formatting columns or hiding columns ton ASP .Net Web Controls 2 02-11-2004 04:09 AM
DataGrid Formatting Columns ISsues coleenholley ASP .Net 1 02-01-2004 06:21 AM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM
formatting numbers & columns in datagrid John Wilson ASP .Net 1 09-02-2003 07:40 PM