Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Set gridview column to currency

Posted on 2012-03-31
1
Medium Priority
?
1,565 Views
Last Modified: 2012-03-31
I am using vb.net, datagridview.

I need a way or code to set a column on the datagridview to be set to currency.

I tried setting the column format using the designer on the gridview settings and set it to currency format. But even then when i enter any numbers into that, whether those numbers have decimal or not the numbers just get added as numbers, they don't have the currency symbol next to it and even don't get decimal points when i just enter a whole number

Hope i was clear with my question

thanks in advance.
0
Comment
Question by:baabaa_nl
1 Comment
 
LVL 17

Accepted Solution

by:
nepaluz earned 2000 total points
ID: 37791225
If your datagridview is not databound, then you will have to set the column type before this happens (else the datagridview assumes thevalue is a string!) Add this inyour form load event
DataGridView1.Columns(0).ValueType = GetType(Decimal)

Open in new window

to apply to your DataGridView1 in the first column
Or in the designer
desg
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question