Solved

msflexgrid - Merging header cells without losing selection hightlight

Posted on 2001-08-30
10
1,272 Views
Last Modified: 2008-03-10
I need to find a way if possible to merge cells strictly in the fixed header rows (which I have done). But not lose the selection highlight. I still want to be able to multselect cells.

Here is a quote from documentation msflexgrid - merge cells:

"When MergeCells is set to a value other than 0 (Never), selection highlighting is automatically turned off. This is done to speed up repainting, and because selection of ranges containing merged cells may lead to unexpected results."

I understand their reasons, but I am only merging cells in the fixed column headers.

Or is there a better way to label columns/rows where the text can span more then one column and/or row within the header?

Wish msflexgrid had a CellAlignment - "across cells..."

I know there are 3rd party grids with this ability, but trying to avoid 3rd party controls if possible.

Currently use formula ones grid and it works ok. But becoming expensive to keep upgrading.



0
Comment
Question by:RPWard
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:BlaZer
ID: 6441272
i dont understand..could u copy paste your code?
0
 

Author Comment

by:RPWard
ID: 6441319
I have a grid with 13 columns. Two rows are fixed (headers). I want text to span more then one column in the first row (for example). I used the mergecells options to accomplish this. However, using the mergecells options - I lose the ability to multi-select cells within the grid (for cutting and pasting or whatever).

Question is, is there a better way to label headers across columns? Or is there a way to keep selection highlighting on, doing it the way I am doing it?
0
 
LVL 1

Accepted Solution

by:
BlaZer earned 200 total points
ID: 6441382
okay...you could make a Fake selection by just changing the backcolor in the cells.....

a little something like this

Dim LastSelectedRow As Long
Dim LastSelectedCol As Long

Private Sub MSFlexGrid1_Click()
If LastSelectedRow <> 0 Then
For x = LastSelectedRow To MSFlexGrid1.Row
For y = LastSelectedCol To MSFlexGrid1.Col
MSFlexGrid1.Row = x
MSFlexGrid1.Col = y
MSFlexGrid1.CellBackColor = RGB(0, 0, 255)
Next
Next
End If
LastSelectedRow = MSFlexGrid1.Row
LastSelectedCol = MSFlexGrid1.Col

End Sub

would somethin like that be usefull?
0
 

Expert Comment

by:kuppachi
ID: 6441508
use this for the columns u need to merge
MSFlexGrid1.MergeCol(1) = True
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6441656
I would have suggested exactly what Blazer has suggested. :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:RPWard
ID: 6441861
Kuppachi - Thanks, but I have the merge figured out. Trying to figure a way to have selection highlighting on.

Blazer - This may help, need to check it out - Thanks.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6441975
Unfortunately, I was never able to get it working properly.  I ended up turning off the merge, because it was more important for me to have the selection working properly than the merged cells look.  While this works ok for row headers (leaving a blank row header instead of repeating it) it doesn't look very good for column headers and I also wish the flexgrid had alignment across cells.

I've never used the Hierarchical Flexgrid, does it have the same limitations?  As far as third party goes, we have FarPoint Spread here, and it is good, but it is often too complex for the simple grid work that I need.
0
 

Author Comment

by:RPWard
ID: 6441986
PaulHews, I have tried both msflexgrid and mshflexgrid - same limitations. I am going to give Blazer's suggestion a try. See what happens.
0
 

Author Comment

by:RPWard
ID: 6444570
Thanks BlaZer, your answer pushed me in the right direction. Seems like it's going to work. Thanks again.
0
 
LVL 1

Expert Comment

by:BlaZer
ID: 6448839
no problem....glad to help :=
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

920 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

17 Experts available now in Live!

Get 1:1 Help Now