473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid - formatting columns (i.e. add £ symbol)

I am populating my datagrid 'by hand' by that I mean that i am not
using the wizard!

What I would like to know, is if I can format my colums - for example
if I have a column that is returning 100.0500, how would I get it to
display £100.05.

Also, is it possible to create "total rows" to total up the values of a
given column?

Many thanks

Darren

Jun 6 '06 #1
3 2049
Darren,

1) you will have to set the culture info on web.config to uk and set the
DataFormatstrin g property of the bound column in the datagrid.

On web.config file, add the following
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColum n DataField="Pric e" HeaderText="Pri ce in GBP"
DataFormatStrin g={0:C}"></asp:BoundColumn >

2) Here you go:
http://support.microsoft.com/default...en-us%3B326339

best regards
Sundar Raghavendran
----------------------------------------------------------------------------------------------
"daz_oldham " <Da************ **@gmail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
I am populating my datagrid 'by hand' by that I mean that i am not
using the wizard!

What I would like to know, is if I can format my colums - for example
if I have a column that is returning 100.0500, how would I get it to
display £100.05.

Also, is it possible to create "total rows" to total up the values of a
given column?

Many thanks

Darren
Jun 6 '06 #2
Thanks very much for that Sundar.

I'm back at home now, but I will have a look at that in the morning.

Regards

Darren

Sundar Raghavendran MCP wrote:
Darren,

1) you will have to set the culture info on web.config to uk and set the
DataFormatstrin g property of the bound column in the datagrid.

On web.config file, add the following
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColum n DataField="Pric e" HeaderText="Pri ce in GBP"
DataFormatStrin g={0:C}"></asp:BoundColumn >

2) Here you go:
http://support.microsoft.com/default...en-us%3B326339

best regards
Sundar Raghavendran
----------------------------------------------------------------------------------------------
"daz_oldham " <Da************ **@gmail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
I am populating my datagrid 'by hand' by that I mean that i am not
using the wizard!

What I would like to know, is if I can format my colums - for example
if I have a column that is returning 100.0500, how would I get it to
display £100.05.

Also, is it possible to create "total rows" to total up the values of a
given column?

Many thanks

Darren


Jun 6 '06 #3
I got this working Sundar (formatting as currency) but for some reason
it only worked when I set the cell to be a template cell.

Thanks again

Daz

daz_oldham wrote:
Thanks very much for that Sundar.

I'm back at home now, but I will have a look at that in the morning.

Regards

Darren

Sundar Raghavendran MCP wrote:
Darren,

1) you will have to set the culture info on web.config to uk and setthe
DataFormatstrin g property of the bound column in the datagrid.

On web.config file, add the following
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColum n DataField="Pric e" HeaderText="Pri ce in GBP"
DataFormatStrin g={0:C}"></asp:BoundColumn >

2) Here you go:
http://support.microsoft.com/default...en-us%3B326339

best regards
Sundar Raghavendran
----------------------------------------------------------------------------------------------
"daz_oldham " <Da************ **@gmail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
I am populating my datagrid 'by hand' by that I mean that i am not
using the wizard!

What I would like to know, is if I can format my colums - for example
if I have a column that is returning 100.0500, how would I get it to
display £100.05.

Also, is it possible to create "total rows" to total up the values of a
given column?

Many thanks

Darren


Jun 9 '06 #4

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

Similar topics

2
5271
by: Victor Bien | last post by:
W3C says somewhere that tables should not be used for formatting columns etc. but that style sheets should be used instead. This has a major unlearning/relearning implications for me (and just about everyone else I suppose). That also makes Hotdog ver 6.5 and "Using htnl 4" by Molly Holzschlag Publ Que instantly out-of-date! Where are the documents that show you how to do this? The tutorial on the W3C site is too elementary for me. ...
4
5401
by: | last post by:
I have a datagrid with a template column that has a hyperlink and a label. The hyperlink text is bound to Title from my dataset and the label text is bound to Author in the dataset. The grid displays with the template columns showing the Title and the Author from the first row in all rows. The other none template columns are fine. Obviously I am not understanding something here. What am I missing????? -- Barry Fitzgerald
7
4672
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is quite ugly. The black area is larger then it is once an item is added. How can I solve this problem either by: A) Having only the header black and the rest of the empty block white or gray (preffered solution) B) Having the color gray or white...
1
1231
by: coleenholley | last post by:
I'm getting frustrated with trying to format a datagrid that is entirely populated dynamically using a class module written in VB .Net (No C# used!) We connect to a DB2 database using an RPC that is written in COBOL. The connection to the datagrid works in the code-behind in the class module, when I check the 'Create columns automatically at run time' box. If I don't select that, I don't get any data, even if I go in and add all my columns in...
1
960
by: Mike Fellows | last post by:
Help, Im used to vb.net and have been given a web project to do i have a datagrid which i populate with data (surprisngly) one of the columns in my datagrid contains a long string in vb.net i used to do the following: Dim ts As New DataGridTableStyle()
1
951
by: Hyrum Mortensen | last post by:
Hello, I have a basic question about datagrids. I want to format a datagrid such that all data can be displayed without having to scroll to the right. Currently, I display a datagrid with > 20 columns and it's a hassle not to see all of the columns on one screen without having to scroll to the right. How do I do this? Thanks
1
1423
by: tfs | last post by:
I am reading into a datagrid and can't seem to get the "execution time" column (the 3rd column) to move to the right. My problem is that the last character in the 2nd column is right up against the end of the column and the 3rd column is too close and confusing. So I was trying to move the data in the 3rd column over a few spaces. So I did the following:
2
1121
by: Simon Harris | last post by:
Hi All, I wish to change the background colour and contents of a datagrid cell based on the value of one of the columns on a per row basis. So, for example, if column A's value is 1, column 2 should be red with 'No' written in it. If column A's value is 0, column 2 should be green with 'Yes' written in it. Can anyone advise how I could achieve this? (I know how to display/populate the datagrid).
2
1461
by: John Dann | last post by:
I've got what seems to be a common problem with the DataGrid control - I want to display a dataset one of whose columns (always the first column) is a datetime column. But only the date displays not the time. The dataset structure is only defined at runtime so I want to set the format of just this one datetime column programmatically. Would anyone be kind enough to tell me the simplest way of doing so. This is just a detail, albeit an...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.