Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Gridview dataformatstring
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
William Adams  
View profile  
 More options Jun 30 2009, 12:16 pm
From: William Adams <wbca3110...@gmail.com>
Date: Tue, 30 Jun 2009 10:16:28 -0600
Local: Tues, Jun 30 2009 12:16 pm
Subject: Gridview dataformatstring

I am sure many may have encountered this issue in VS 2008, working with .NET
3.5 web apps.

The issue is using "dataformatstring" for a gridview's boundfield. I have a
number like 123,000,000, which I want displayed as 123 million.
ToString("0,, million") achieves this nicely elsewhere for a label with
numbers coming from another datasource. {0:0,, million} fails to work in the
boundfield dataformatstring property (same for {0,, million}). For the time
being, I have resorted to having the particular datasource query dividing
this number by 1 million, and then the dataformatstring property for that
column set to {0:0 million}. This to me just seems wrong, but achieves the
desired end result.

Would anyone happen to have some insight that might help me understand how I
could better achieve this? Everywhere in google is the same thing: set
htmlencode = false and/or htmlencodeformatstring = false. This has not
resolved it at all for me.

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Brandsma  
View profile  
 More options Jun 30 2009, 12:20 pm
From: Chris Brandsma <chris.brand...@gmail.com>
Date: Tue, 30 Jun 2009 10:20:22 -0600
Local: Tues, Jun 30 2009 12:20 pm
Subject: Re: [BSDG] Gridview dataformatstring

For cases like this I tend to use custom formatting.  So instead of passing
the value as a number, pass it as a preformatted string.
The thing is you don't have too many formatting rules, so setting it up
should be easy.  Then, if you do it correctly, if any other screen needs the
same value it can also grab the correctly formatted value, and you don't
have to repeat you formatting strings.

On Tue, Jun 30, 2009 at 10:16 AM, William Adams <wbca3110...@gmail.com>wrote:

--
--------------------------------
Christopher Brandsma
http://www.ChrisBrandsma.com
http://www.ElegantCode.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google