473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Is there a way to format a cell in a GridView?

S_K
Hi,

Is there anyway to format a cell such that it displays every number as
a floating point with both numbers to the right of the decimal
displayed irregardless of the number. For example the number 23.00
would be displayed as "23.00" rather than "23".

Any help out there?

Thanks so much
Steve

Oct 23 '07 #1
3 1420
Hi,

Try the "n2" format for this column...

--
Patrice

"S_K" <st***********@yahoo.coma écrit dans le message de news:
11*********************@i38g2000prf.googlegroups.c om...
Hi,

Is there anyway to format a cell such that it displays every number as
a floating point with both numbers to the right of the decimal
displayed irregardless of the number. For example the number 23.00
would be displayed as "23.00" rather than "23".

Any help out there?

Thanks so much
Steve

Oct 23 '07 #2
On 23 , 20:27, "Patrice" <http://www.chez.com/scribe/wrote:
Try the "n2" format for this column...
.... and do not forget to set HtmlEncode to "false"

<asp:BoundField DataField="SomeNumber" DataFormatString="{0:N2}"
HtmlEncode=false/>

Regards,
Mykola
http://marss.co.ua

Oct 23 '07 #3
S_K
On Oct 23, 11:38 am, marss <marss...@gmail.comwrote:
On 23 , 20:27, "Patrice" <http://www.chez.com/scribe/wrote:
Try the "n2" format for this column...

... and do not forget to set HtmlEncode to "false"

<asp:BoundField DataField="SomeNumber" DataFormatString="{0:N2}"
HtmlEncode=false/>

Regards,
Mykolahttp://marss.co.ua
Thanks!
That worked well!

Steve

Oct 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jon S via DotNetMonster.com | last post by:
HI all, I'm returning a dataset to a gridview control. When the gridview asp.net control is populated from the returning dataset some of the cells remain empty. This is expected as some data...
3
by: =?Utf-8?B?bmt3?= | last post by:
I have a gridview which need to filled by various data according to user's action. I want to format the dynamical displayed data. For example the number should be right aligned, datetime column...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi, I can return the rowindex using SelectedRow or SelectedIndex But, how do I get my code to return the cell or column index of a selected row in my gridview? thanx -- Regards,
3
by: Bill Gower | last post by:
I have an cell which contains a field member which is filled with String.Empty. When I retrieve the value in the cell with Cells.Text.ToString() and try to compare it to String.Empty, I can't...
2
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi, I've bind a grdiview to a database and it's working fine. but what I want to do is if the data in certain cell exceed the cell width the that cell will only show the words with some dots...
14
by: Mike | last post by:
I have a gridview that has a button in the last cell of each row. I want to get the text from cell 1 for that row the button was clicked on. So if my gridview looks like this: N-12 BMW ...
1
by: Jan Erik Hansen | last post by:
I have a gridview that I will output to an email. I try to format a certain cell but it doesn't seem to have any effect, Can I set the htmlencode for a bound column = false in code? I have...
4
by: foolmelon | last post by:
Before AJAX, we were able to focus a cell in a gridview during a fullpage postback. After putting the gridview inside an UpdatePanel, we cannot focus a cell in this gridview anymore. Does anybody...
4
by: =?Utf-8?B?ZGNoMw==?= | last post by:
Is there a way to conditionally format a dateTime field to produce on result if the value is 10/31/2008 12:00 AM (user didn't enter a time) and another result if the value is 10/31/2008 5:30 PM...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.