Setting a property for an object in a Form of a Grid

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
tfabacher
Posts: 15
Joined: Mon Mar 03, 2014 8:31 pm

Setting a property for an object in a Form of a Grid

Post by tfabacher » Sun Jul 06, 2014 3:42 pm

We currently have a transparent data grid using grouped forms, but still wanted to highlight when the user clicks on a row. So it seems that we can not use the default highlight property, so we added a Rectangle to the form group.

So we want to show the rectangle on mouse down. But we have several problems:

1.How do I select index of the group of the row so I can set ONLY the group of the selected row? I do not know how to get and set the Index of the row to the group and set set the visible property to true.

Code: Select all

on mousedown
   put the dgHilitedLines of group "DataGrid 1" into theLine
   --How to select the index of theLine in the row Array so I can show bgHighlight
  set the visible of graphic "bgHighlight" of group "DataGrid 1"  to true

end mousedown

2. Also now that I created "on mousedown", The first line in the MouseUp stop working. It read dgHilitedLines as Empty

Code: Select all

put the dgHilitedLines of group "DataGrid 1" into theLine
But if there is no mousedown, then everything is find.

tfabacher
Posts: 15
Joined: Mon Mar 03, 2014 8:31 pm

Re: Setting a property for an object in a Form of a Grid

Post by tfabacher » Sun Jul 06, 2014 7:51 pm

I figured out that I could do this...

Code: Select all

on mousedown
set the visible of graphic "bgHighlight" of me  to true
end mousedown
But the mouseup code does not work properly???

Why would the mousedown effect the ability to get the dgHilitedLines??

put the dgHilitedLines of group "DataGrid 1" into theLine

tfabacher
Posts: 15
Joined: Mon Mar 03, 2014 8:31 pm

Re: Setting a property for an object in a Form of a Grid

Post by tfabacher » Sun Jul 06, 2014 8:09 pm

Well I am happy to report that the problem is solved:

If you use both mouseup and mousedown for the datagrid, I suggest you use dgLine property and NOT use dgHilitedLines

WORKS: put the dgLine of me into theLine

DOES NOT WORK: put the dgHilitedLines of group "DataGrid 1" into theLine

Post Reply