Solved

MSFlexGrid control and displaying numeric values

Posted on 2003-11-13
11
454 Views
Last Modified: 2013-11-20
Hi

I am having a strange problem with the MSFlexGrid control when trying
to display numeric values.

"123"     Does NOT get displayed

",123"    Does get displayed


Can anyone explain why this is happening and how to rectify the problem
either with MSFlexGrid or maybe its me :-)

Thanks in advance
LittlePerson

0
Comment
Question by:LittlePerson
  • 5
  • 4
  • 2
11 Comments
 
LVL 1

Expert Comment

by:pescatera
ID: 9742866
Which version of visual c++ are yuo using? I use de .Net and can´t use de msflexgrid, how could you use it? I am asked to license the control
0
 
LVL 1

Expert Comment

by:pescatera
ID: 9742882
Sorry, o forgot to ask you how did you insert the data into the grid. I used the same grid in visual basic, and used to insert numerical values using the .textarray, and formating the number with format number in order to display it properly.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9747441
What happens with 12 or 1234 or even 123.4?  It looks like it is trying to format with the thousands separator but getting it wrong.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:LittlePerson
ID: 9747458
Hi Andy

All values are in String representation. so "12", "1234" and "123.4" do not get displayed. If I
prefix a non numeric character to any of these it gets displayed fine.

hmmm



LittlePerson

0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9747507
I've not used the flexgris but that sounds like it expects a string for displaying.  
You say "12" etc do not get displayed.  How are you filling the cells.
0
 

Author Comment

by:LittlePerson
ID: 9747525
SetTextMatrix(row,col, either CString or LPCTSTR)
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9747628
Do you mean

double d = 123.4;
CString s;
s.Format("f.2", d); //s="123.4"
SetTextMatrix(rwo, col, s);

doesn't display anything?

Could you post your code for the original 123 appearing as ,123 please.
0
 

Author Comment

by:LittlePerson
ID: 9747642
I have tried a couple of ways

m_dataGrid.SetTextMatrix(1,1, _T("123.000"));

CString str = "123";
m_dataGrid.SetTextMatrix(1,1, str);

m_dataGrid.SetTextMatrix(1,1, "123");

None get shown in the grid!

Cheers
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9747675
But
m_dataGrid.SetTextMatrix(1,1, "a123");
does get shown?
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 50 total points
ID: 9747736
I have just searched my MSDN and found the following
Q196833

From that I downlaoded the EditGrid.ext from the MS site.
I have added in OnInitDlg
m_grid.SetTextMatrix(1, 1, "123");//and other values

All display correctly.

It looks like you have a problem with your flexgrid control itself.
0
 

Author Comment

by:LittlePerson
ID: 9747777
Thanks Andy

I'll look into that asap.

Cheers
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

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 79
ASCII Non-Printable characters/codes and their HTML equivalents 6 132
sumDigits challenge 9 170
matchUp  challenge 9 115
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
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…

830 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