Datagrids - Highlight one column cell?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Scoperzor
Posts: 78
Joined: Tue Jan 27, 2015 1:10 pm

Datagrids - Highlight one column cell?

Post by Scoperzor » Fri May 29, 2015 10:02 am

Hi all

I'm trying to figure out if it's possible to highlight only one column cell at a time in a datagrid, rather than the default entire row selection. I would like the user to be able to select a single cell from a 4x5 grid, and for that cell to be highlighted. Can this be done?

Thanks.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10394
Joined: Wed May 06, 2009 2:28 pm

Re: Datagrids - Highlight one column cell?

Post by dunbarx » Fri May 29, 2015 2:52 pm

Datagrids. Well,

Code: Select all

send "editcell col 1,2" to grp 1
does not stick. Though it hilites the cell momentarily. Maybe there is a property that must be set?

And:

Code: Select all

select fld "col 1 0002"
selects a field, but that is sort of in edit mode, not run mode.

Klaus? Trevor?

Craig Newman

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: Datagrids - Highlight one column cell?

Post by sritcp » Sat May 30, 2015 6:07 pm

The "hilite color" is a DG property that refers to the row; you cannot use it to highlight an individual cell.

You can, however, script the FillinData to set "the opaque" of the cell to true and "the bgColor" to your desired highlight color.
You can do this conditionally (for the correct row and column) so only the chosen cell is highlighted.

See
http://forums.livecode.com/viewtopic.ph ... 226#p62226
for the code and an example image.

Regards,
Sri

Post Reply