Solved

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

Posted on 2006-06-29
2
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

738 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