Datagrid click and set background color for a column

zryip theSlug zryip.theslug at gmail.com
Wed Jun 23 13:09:43 EDT 2010


Hi Josep,

A possible way consists to use the field in the cell to accomplish the task:

1) Link a default column behavior to your Data Grid

2) In this default behavior add a mouseUp handler:

on mouseUp pMouseBtnNum
if pMouseBtnNum is 1 then
  if (word 1 of the target is "field") then
    if (the backcolor of fld 1 of me is empty) then
       set the backcolor of fld 1 of me to red
       set the style of fld 1 of me to opaque
    else
       set the backcolor of fld 1 of me to empty
       set the style of fld 1 of me to transparent
     end if
    end if
  end if
end mouseUp

By default the style of the editor field of a cell is transparent, so
you have to set it to opaque to show its color:
set the style of fld 1 of me to opaque


Regards,

2010/6/23, JosepM <jmyepes at mac.com>:
>
> Hi,
>
> How can I change the background color of a cell of a datagrid by clicking
> in?
>
>
> Salut,
> Josep
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/Datagrid-click-and-set-background-color-for-a-column-tp2265290p2265290.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the Use-livecode mailing list