Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-29
2
Medium Priority
?
297 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 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