473,404 Members | 2,137 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,404 software developers and data experts.

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 2039
Darren,

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

On web.config file, add the following
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColumn DataField="Price" HeaderText="Price in GBP"
DataFormatString={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.googlegr oups.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
DataFormatstring property of the bound column in the datagrid.

On web.config file, add the following
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColumn DataField="Price" HeaderText="Price in GBP"
DataFormatString={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.googlegr oups.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
DataFormatstring property of the bound column in the datagrid.

On web.config file, add the following
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="en-gb" />
and on the webform add this foll. line:
<asp:BoundColumn DataField="Price" HeaderText="Price in GBP"
DataFormatString={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.googlegr oups.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
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...
4
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...
7
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...
1
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...
1
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...
1
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...
1
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...
2
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.