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

x
?
Solved

Format and Justify FlexGrid Cells

Posted on 2004-04-02
5
Medium Priority
?
888 Views
Last Modified: 2006-11-17
Hi Experts,
  I am using a Flex Grid that has text in the first column and then numbers in the rest of the columns.  There are two rows of headers as well.  My problem is that sometimes the numbers will be in dollars, sometimes in percent, sometimes just a plain number, and occasionally it will actually be TEXT.  I need them to be formatted correctly based on info from an array that I have AND I need all columns (other than the first column and except for the first two rows) to be right justified regardless of whether it's a number or text.  How can I accomplish this?
  Why is it that the flexgrid puts all numbers right justified and then text left justified if everything in a flex grid is text anyway??
Thanks in advance for the help!
-Ren
0
Comment
Question by:Ren
[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
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Xentor_
ID: 10743121
For idx = 1 to flex.Cols.Count - 1
  flex.ColAlignment(idx) = flexAlignRightCenter
Next idx

That'll right-justify everything except the first column.  I don't remember if it affects fixed rows, but you can always specifically set the alignment of the first two rows to something else.
0
 
LVL 3

Accepted Solution

by:
santosh26676 earned 2000 total points
ID: 10756941
I think You need to first set the alignment for all the cols (except first) to right and then modify the individual cells of the first two rows to set the alignment to center.

0
 

Author Comment

by:Ren
ID: 10775246
Good call santosh, that was quick and easy!  After a bit of research, I found that MSFlexgrid.ColAlignment(intCTR) = flexAlignRightCenter worked well.
-Ren
0
 

Author Comment

by:Ren
ID: 10775289
santosh,
I went ahead and gave you the points, I was trying to catch up on a few open questions and forgot about the main part of this question.  I don't suppose you know how to format individual cells in currency, 000's or percent, do you?
-Ren
0
 
LVL 3

Expert Comment

by:santosh26676
ID: 10780774
Yes I can answer your next question too. but will I get some more point.

Just Kidding!! I will send you the code to do this.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

704 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