Solved

MSFlexGrid - how can I format grid lines?

Posted on 2008-10-27
4
969 Views
Last Modified: 2013-11-28
I am developing an application and am using a flexgrid control to display data.  This is not bound to data but is being loaded and modified in code.

What I really need is to control how the grid lines apparently look, for example I'd like a thicker horizontal line between each two rows.

I know that the grid lines in the control do not offer this functionality and I've tried simulating the effect by using either a line control or a picture box control and positioning it on top of the grid in the appropriate place.

Unfortunately, it would appear that the grid always appears on top of everything else and so these controls cannot be seen!

How can I take control of the way specific grid lines appear?

What I've done so far is to have some extra rows of small height and with the required background colour but it's hardly satisfactory and requires quite a lot of extra programming to ensure that the mouse clicking on, or the cursor keys moving into, these 'fake' cells are handled.
0
Comment
Question by:trentham
  • 2
  • 2
4 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
trentham,

Are you even sure this is even possible?

Why not just alternate the row color?
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_10207284.html

JeffCoachman
0
 

Author Comment

by:trentham
Comment Utility
I'm NOT sure that this is possible which is why I've posted the question to a wider audience!

Someone may have a definitive answer as to whether another control can be seen ON TOP of one of these grids.  There are suggestions that VB6 can do this but none of those approaches have worked with VBA in MSAccess.  For example, an approach that is used to make a cell apparently editable is to overlay an edit control on it ... but in this app, it always seems to get hidden by the grid!

Unfortunately the more obvious approach of alternating row colour is not ideal.  The colours of rows indicates various other things.  This is a booking calendar and the two connected rows indicate daytime and evening for each room.  The background colour is used to indicate whether it is; normally available, not available, already booked, etc, etc. - although I've not ruled this approach out entirely!

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
OK,

Good luck with this!
;-)
0
 

Accepted Solution

by:
trentham earned 0 total points
Comment Utility
OK, it seems that what I want is probably not possible so the following is an outline of my workaround.

In order to apply apparent horizontal grid lines of a different colour I inserted extra rows, one per gridline, and set them to have a low heigh valuet.  Providing the background colour of that row then gave me the visual effect I was after.  I refer to these cells as 'gridline cells'.

However this causes a number of inconveniences and there are things to handle:-

1. It's a bit more awkward now because if I want row 7, say, there may be grid lines to add in to fnd out that it is really row 10 now!  There are lots of ways to handle this, including a simple mapping function.

2. In my grid, the user can click on a cell.  It is just as possible for them to click on one of these gridline cells and then the cursor appears to vanish!  I recognise this and also keep track of what cell they were in last.  When they click on such a gridline cell they are repositioned to either the one above or the one below where they clicked, depending on where they were last.

3. In my grid the user can move around wth the cursor keys.  It's a simple matter when up or down cursor is used and a gridline cell is landed on to 'bump' the focus into the next cell.

It's not a tidy solution but it gives me what I want!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now