On Apr 23, 2009, at 3:46 AM, Josep wrote:
I tryed your example and doesn't work for me. I create a new field
text and
put your code into the datagrid and the focus go to the text field
but go
back to the datagrid. If I click with the right button then work,
but not
detect the new click over other col in the same row if I not change
the
selection row.
Umm, it turns out that I accidentally fixed this somehow in the data
grid library I'm using. I just reverted to the version that shipped
with 3.5 and I see the same behavior as you describe. I'm not sure
what I did but if you email me off-list I can send you and updated
revdatagridlibrary stack with the fix.
I don't use the built-in editable capabilities so I need edit only
one or
two cols, and handle the function keys to query database to get
codes and
perform operations for each line when the user fill the data.
It's posible block many cols and auto calculate other cols versus
the values
of fill data?
I haven't documented all of the fancy things you can do with field
editing yet but here is some information that will hopefully get you
started. I will formalize this into proper lessons at some point.
You can control exactly which columns allow editing by modifying the
default behavior script for columns. See this lesson on overriding the
default behavior with your own:
<http://revolution.screenstepslive.com/spaces/revolution_tools/manuals/datagrid/lessons/3966-How-Do-I-Override-the-Default-Behavior-For-Rendering-Data-to-a-Cell-
>
After you create your own behavior script according to the directions
then you can customize the EditValue handler in your behavior script
to only allow editing of certain columns:
command EditValue
switch the dgColumn of me
## allow editing for these columns only.
case "col 1"
case "col 2"
EditFieldText the long id of me, the dgIndex of me, the
dgColumn of me
break
end switch
end EditValue
and if the user go back and modify the values, this can be
recalculated?
EditFieldText takes up to three parameters. The first is the long id
of the field whose contents will be edited. The second is the index
(internal data grid index) of the data you want to edit. The third is
the name of the key you want to edit (in this case the column name).
When the editing field closes the data will automatically be saved to
the data grid, but not before a 'CloseFieldEditor' message is sent to
the field that was referenced in parameter 1. If you want to
recalculate values in other cells when one cell is edited then add a
handler like this to your data grid group script:
on CloseFieldEditor pFieldEditor
## Which column is being edited?
switch the dgColumn of the target
case "col 1"
## recalculate other columns...
break
end switch
end CloseFieldEditor
Quick Tip: If you don't want the data grid to save the new value for
some reason (e.g. invalid value) then return "cancel" from
CloseFieldEditor.
Can I trap the rawkeycode?
When a call is made to EditFieldText a new editing field is created by
the data grid and the message 'preOpenFieldEditor' is sent to the
field that was clicked on. Just write a behavior that has all of the
rawkeyDown code you need and add this handler to your data grid group
script:
on preOpenFieldEditor pFieldEditor
set the behavior of pFieldEditor to the long id of button
"MyBehaviorWithRawKeyDownProcessing"
end preOpenFieldEditor
Voila - you have complete control over input. Behaviors really are our
new best friend.
Can change the color of the entire line determined by some value in
the
line? For example to show if exist or not stock for this line? But
this
value will used in two cases:
a) query a database
b) fill data directly and on the fly changing the color of the line
I read the datagrid manual and don't see how change the colors. I
think that
maybe is posible perform calculate field via behaviors cols. But I
haven't
clear how do it.
The lesson I link to above shows how to change the background color of
a cell. Look for the "Example: Coloring Cells" step at the end of the
lesson. Here is the link again:
<http://revolution.screenstepslive.com/spaces/revolution_tools/manuals/datagrid/lessons/3966-How-Do-I-Override-the-Default-Behavior-For-Rendering-Data-to-a-Cell-
>
Regards,
--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com - www.screensteps.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution