MSHFlexgrid displayed value

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Bob (anonymous_at_discussions.microsoft.com.invalid)
Date: 07/16/04


Date: Fri, 16 Jul 2004 12:25:13 -0700

Hello all:

I have an MSHFLEXGRID control in VB 6.0, and I am trying to implement a
best-fit format for each cell. Therefore, depending on the cell content, I
have a routine, which returns the format string for me. However, I have a
problem. The grid holds the contents of my values, meaning, I do not have
an extra array holding the values. I want to be able, to read the value of
the cell using the TEXT or TEXTMATRIX properties, and then using my routine,
get the format string, and display the value to the user. Please note that
by doing displaying the value, I do not wish to use the TEXT or TEXTMATRIX
because I may loose accuracy. For example, the inputted value may be
1234.123456789, and the format string may be "#,##0.000". So I want the
grid to display 1,234.123, but if I access the grid value by the text or
textmatrix to return the original number 1234.123456789.

Does anyone know either through VB, or API, how to set and read the display
value of the grid without affecting its stored internal value?

I appreciate your help very much.

Bob

PS. I have looked at the grid control from componentone, and that control
has the same problem. It does not allow me to set the format for each cell,
it only lets me set it for the entire column.



Relevant Pages

  • Re: Problem with display format
    ... I think what you are seeing is an empty cell and a cell with a zero ... In the advance tab for a member or calculated member there is a ... you can also type in your own format string. ...
    (microsoft.public.sqlserver.olap)
  • Re: zero amounts versus "empty"
    ... One question - is it this format string documented in the SSAS docs anywhere ... I can't find anything that describes the format string in those terms (the closest is the MDX cell format docs, but that only describes two sections to the string. ... but the cell was really empty and excluded by default if the non empty keyword is used. ...
    (microsoft.public.sqlserver.olap)
  • Re: assign the formatted cell value (date) to another cell?
    ... do kind of wonder why I have to know 2 different function names for doing the same thing in VBA or cell formulas... ... NumberFormat works perfecly, the format string passed to the text function in the cells formula does not convert the format string to the computer's region settings, and thus if you have german regional settings - it will only work if you use "JJJJ-MM-DD" etc. for the format string. ...
    (microsoft.public.excel.programming)
  • Excel VBA - Check/Format String
    ... I would like to check and format string from a cell if a condition is met, ... via using macro button. ... if there is apostrophe in that string, ...
    (microsoft.public.excel.misc)
  • Data Conversion in a grid
    ... I have a custom grid control and I'm stuck on an issue in the data binding. ... Using a method similar to the DataGridColumnStyles class, ... I've added a Format property which will take a format string such as "" ... The underlying data can, of course, be of any type. ...
    (microsoft.public.dotnet.framework.windowsforms)