Solved

Format/Formatinfo of datagrid (vs2003) not formating the data

Posted on 2006-06-29
2
288 Views
Last Modified: 2008-02-01
Hi there,

I have a datagrid setup and its working but its not showing the thousand separater (which in spain we use the . rather than the ,)

so hence 10000 would be represented like so 10.000

I have some code which i thought would work but it isn't. This column i have has values that exceeed 10000 for example.. here is my code

                  System.Globalization.CultureInfo SpanishCultureInfo=
                        new CultureInfo(0x0C0A);
     
                  ts = new DataGridTableStyle();
                  ts.MappingName="Record";
                  
                  style2=new DataGridTextBoxColumn();
                  style2.MappingName="NUM_TITULOS";
                  style2.HeaderText="Titulos";
                  style2.Alignment = HorizontalAlignment.Right;
                  style2.FormatInfo = SpanishCultureInfo;
                  style2.Format = "c";
                  ts.GridColumnStyles.Add(style2);

All the other stuff in the style2 is working i..e Right Alignment, mapping and headertext etc-... the formatinfo/format doesn't seem to be working... as in that column all values are not expressed with the . (dot) as the thousand separater

Can anyone help?

Maybe the column is of type STRING..... but should that make a difference?

Thanks in advance

Ian
0
Comment
Question by:ianinspain
2 Comments
 
LVL 5

Accepted Solution

by:
t_itanium earned 500 total points
ID: 17011535
look


after binding your datagrid go over each row of  it change the format of the desired column///


foreach row i datagridrows
{
do the formating here

}

somehting like this..

cheers
0
 

Author Comment

by:ianinspain
ID: 17019038
Yep this is what i ended up doing was changing the dataset rather than the grid...

thanks

ian
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now