Datagrid Help... @#$%&^**
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Datagrid Help... @#$%&^**
I'm somewhat disillusioned with the data grid. I cannot for the life of me fathom this control out. I want to place a button in a column and place an icon following the demo available from RR. I follow the example step by step and I cannot get it to work. I have noticed that there are slight difference in the datagrid between the demo and the community version. 6.1.2(rc 1). It's really frustrating. I've watched the video countless times. I've also followed the manual step by step and that too has variations.
I'm using the table layout and not the form. Please don't tell me to use the "form" as this is not what I'm looking for.
Can someone please point me to some examples that work, I would be most grateful.
I'm using the table layout and not the form. Please don't tell me to use the "form" as this is not what I'm looking for.
Can someone please point me to some examples that work, I would be most grateful.
Re: Datagrid Help... @#$%&^**
Hi Nigel,
don't shoot the messenger, but Datagrids of kind TABLE can only display text in FIELDS!
For buttons and other nice stuff in a ROW you need it to be of kind FORM.
BUT mayve you can simply "fake" the look by using a field and set its first char's imagesource?
This requires a custom behavior for your datagrid rows however.
And yes, datagrids a evil bests!
Best
Klaus
don't shoot the messenger, but Datagrids of kind TABLE can only display text in FIELDS!
For buttons and other nice stuff in a ROW you need it to be of kind FORM.
BUT mayve you can simply "fake" the look by using a field and set its first char's imagesource?
This requires a custom behavior for your datagrid rows however.
And yes, datagrids a evil bests!
Best
Klaus
Re: Datagrid Help... @#$%&^**
Well, not according to the manual and the demo!!!!!!
Re: Datagrid Help... @#$%&^**
I've got version 5.5.3 and the datagrid helper and that works but not in the community version. I'm somewhat confused by this. I'm trying to introduce LC at work by doing a small project and this is holding me up. I'm using the community version to do the application in as they develop MS while my personnel one is IOS version. But still, I'm of the understanding that they are the same, par that you can't compile for pad's and mobile phones
Last edited by NigelS on Mon Sep 30, 2013 4:52 pm, edited 1 time in total.
Re: Datagrid Help... @#$%&^**
Klaus is right about the "table" style being suitable only for text. Before you give up, have you turned to the "form" style? The lessons, manual and demo are all for nought if you are using the wrong one.
Datagrids take getting used to, since they are composite objects and almost have a language (and mind) of their own, though it really is all LC.
Craig Newman
Datagrids take getting used to, since they are composite objects and almost have a language (and mind) of their own, though it really is all LC.
Craig Newman
Re: Datagrid Help... @#$%&^**
Do you have an url to this?NigelS wrote:Well, not according to the manual and the demo!!!!!!
Re: Datagrid Help... @#$%&^**
I'm not trying to be pain in the ass. I've included some screen shots of the example and one can clearly see that a table is been used. This was taken from the demo.
Re: Datagrid Help... @#$%&^**
This may help shed some light on the subject (notice, it refers to tables)
http://lessons.runrev.com/s/lessons/m/d ... -s-columns
Shalom
http://lessons.runrev.com/s/lessons/m/d ... -s-columns
Shalom
Re: Datagrid Help... @#$%&^**
Check this stack. It could give you some ideas and reverse engineering :
http://forums.runrev.com/viewtopic.php? ... 540#p78299
http://forums.runrev.com/viewtopic.php? ... 540#p78299
-
- VIP Livecode Opensource Backer
- Posts: 219
- Joined: Mon Dec 05, 2011 5:35 pm
Re: Datagrid Help... @#$%&^**
I sympathize with you Nigel. It has been a long difficult road to even get to my limited understanding of data grids.
I thought I would ask a further question about showing/hiding a delete button in any given row and then having that delete button delete the row it's in if pressed. I asked in a different thread but I couldn't get the code that was suggested to work for the life of me.
I can get data in and out of rows and get the rowIndex and I can put a delete button in the row template but can't get the button to show or hide or do anything for the life of me. Any advice?
If I ever get this "slide to delete" working in a data grid I swear I am going to post it in the share section.
I thought I would ask a further question about showing/hiding a delete button in any given row and then having that delete button delete the row it's in if pressed. I asked in a different thread but I couldn't get the code that was suggested to work for the life of me.
I can get data in and out of rows and get the rowIndex and I can put a delete button in the row template but can't get the button to show or hide or do anything for the life of me. Any advice?
If I ever get this "slide to delete" working in a data grid I swear I am going to post it in the share section.
Re: Datagrid Help... @#$%&^**
Hi Nigel,
Sorry, I did not know this and never worked this way,
so I cannot give you any hint here...
Best
Klaus
Oh, they really use a TABLE datagrid there!?NigelS wrote:This may help shed some light on the subject (notice, it refers to tables)
http://lessons.runrev.com/s/lessons/m/d ... -s-columns
Shalom

Sorry, I did not know this and never worked this way,
so I cannot give you any hint here...
Best
Klaus
Re: Datagrid Help... @#$%&^**
Hi coffee 1633,
Likewise, (as per Klaus's comment) I found DGs difficult beasts.
I may be able to help you though with regards a button doing something specific. When you say you can't get the button to show... do you mean you can't display the button within a row of your DG form or that you simply can't trap a user clicking on it ?
Maybe I haven't fully understood your post but (if I did, then...) :
place the following script in the behaviour script of your DG :
on mouseup pMouseButtonNum
local sTarget
put the target into sTarget
if pMouseButtonNum = 1 then
if "btnMyButton" is in sTarget then --where 'btnMyButtonName' is the name of your control: button, image...
-- Do something here
end if
end if
end mouseup
I haven't tried to delete a row but... that shouldn't be too onerous either...
Shout if this helps and you'd like a further 'push'...
HTH
Regards
Likewise, (as per Klaus's comment) I found DGs difficult beasts.
I may be able to help you though with regards a button doing something specific. When you say you can't get the button to show... do you mean you can't display the button within a row of your DG form or that you simply can't trap a user clicking on it ?
Maybe I haven't fully understood your post but (if I did, then...) :
place the following script in the behaviour script of your DG :
on mouseup pMouseButtonNum
local sTarget
put the target into sTarget
if pMouseButtonNum = 1 then
if "btnMyButton" is in sTarget then --where 'btnMyButtonName' is the name of your control: button, image...
-- Do something here
end if
end if
end mouseup
I haven't tried to delete a row but... that shouldn't be too onerous either...
Shout if this helps and you'd like a further 'push'...
HTH
Regards
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: Datagrid Help... @#$%&^**
Hi All
Been away at the coast for a break and was using the opportunity to resolve this issue which has been going on for some time. I really need to crack this thing. Anyway, flew back today and only now have managed to look at the reply's. Thanks to all for contributing.
I'll keep this line open and see how far I can get with it. What really has got me twisted with the datagrid is that I'm a professional developer using C# and ASP.NET and this little monster has got (may I dare say it) nickers in a twist. Makes me really angry at myself for not having resolved it by now.
All I can say is "chin up old boy"
Cheers
Nigel
Been away at the coast for a break and was using the opportunity to resolve this issue which has been going on for some time. I really need to crack this thing. Anyway, flew back today and only now have managed to look at the reply's. Thanks to all for contributing.
I'll keep this line open and see how far I can get with it. What really has got me twisted with the datagrid is that I'm a professional developer using C# and ASP.NET and this little monster has got (may I dare say it) nickers in a twist. Makes me really angry at myself for not having resolved it by now.
All I can say is "chin up old boy"
Cheers
Nigel