×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Grid, highlighted row, would like cell to remain highlighted if clicked in...

Grid, highlighted row, would like cell to remain highlighted if clicked in...

Grid, highlighted row, would like cell to remain highlighted if clicked in...

(OP)
Having a brain freeze or senior moment I think.

I have a form with a grid, the user likes that the currently selected record/row is highlighted but
would also like that same highlighting on a cell if the user clicks in it.

At the moment it changes so the background is white.

I've been playing with settings and not getting it - any ideas?

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

(OP)
I seem to have it resolved with the InteractiveChange event of an option group (Lighter, Darker, Darkest options for the user)

CODE

DO CASE
	CASE THIS.VALUE = 3
		THISFORM.GRID1.HIGHLIGHTBACKCOLOR = RGB(0,0,255)
		THISFORM.GRID2.HIGHLIGHTBACKCOLOR = RGB(0,0,255)
		THISFORM.GRID1.SETALL("BackColor", RGB(0,0,255), "Textbox")
		THISFORM.GRID1.SETALL("SelectedBackColor", RGB(0,0,255), "Textbox")
		THISFORM.GRID2.SETALL("BackColor", RGB(0,0,255), "Textbox")
		THISFORM.GRID2.SETALL("SelectedBackColor", RGB(0,0,255), "Textbox")
	CASE THIS.VALUE = 2
		THISFORM.GRID1.HIGHLIGHTBACKCOLOR = RGB(0,128,255)
		THISFORM.GRID2.HIGHLIGHTBACKCOLOR = RGB(0,128,255)
		THISFORM.GRID1.SETALL("BackColor", RGB(0,128,255), "Textbox")
		THISFORM.GRID1.SETALL("SelectedBackColor", RGB(0,128,255), "Textbox")
		THISFORM.GRID2.SETALL("BackColor", RGB(0,128,255), "Textbox")
		THISFORM.GRID2.SETALL("SelectedBackColor", RGB(0,128,255), "Textbox")
	CASE THIS.VALUE = 1
		THISFORM.GRID1.HIGHLIGHTBACKCOLOR = RGB(165,207,240)
		THISFORM.GRID2.HIGHLIGHTBACKCOLOR = RGB(165,207,240)
		THISFORM.GRID1.SETALL("BackColor", RGB(165,207,240), "Textbox")
		THISFORM.GRID1.SETALL("SelectedBackColor", RGB(165,207,240), "Textbox")
		THISFORM.GRID2.SETALL("BackColor", RGB(165,207,240), "Textbox")
		THISFORM.GRID2.SETALL("SelectedBackColor", RGB(165,207,240), "Textbox")
ENDCASE
STRTOFILE(STR(THIS.VALUE),m.WHEREAMI+"GridBkGnd.txt") 

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

AllowCellSelection=.F.

Chriss

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

(OP)
Nice one Chris,

It does rather block the user from copying the contents of the cell though, rendering it 'disabled' in all but colour

Martin

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

(OP)
This is what I have ended up with

Whole row in a user selected (Lighter, Darker and Darkest) highlight and the currently selected cell highlighted
and bordered in red... so the user can copy and paste from it.

The end user is having eye issues, so wants to be able to vary the exact colours on this one feature dependent
on how their eyes are feeling that day.



That data shown is all just for training purposes... so no GDPR issues here I hope

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

Looks good. I also tried to set backstyle of the textbox to transparent, but didn't think about columns sparse being .T. by default.
So setting a backcolor only affects the active row and thus is keeping the row highlight color only in that row. Ideal.

On the other hand if you ever have the need for sparse=.F. column showing its control in every row, you'd also highlight that column.

Chriss

RE: Grid, highlighted row, would like cell to remain highlighted if clicked in...

(OP)
I did, accidentally, set the sparse on one column, but that made it visually confusing
(in my opinion) when the grid changed too much as focus passed from one column to another.

Oddly, I cannot see the image I submitted with my previous comment.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close