Force text to wrap around in a data grid form?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Force text to wrap around in a data grid form?
Hi all,
Still playing with data grids and have discovered another issue with the way the data is presented on my form. I've created a data entry stack which has a field called description in it which is approximately 400 wide and 300 in height. When I type a long word, during testing I am using random characters for testing without a space and the word exceeds the 400 pixels wide limit. I am expecting the word to wrap around onto the next line, but it doesn't. Nevermind, I think that once I dispatch the data to the dgtext in the data grid, the description label will wrap it as I have other fields/labels on the template but unfortunately the label field here just allows the text to overflow and overlap the other fields on my data grid form.
Is there anyway I can force the text to wrap around in the form, I'm trying to prevent the overlapping of fields on my layout.
Thanks as always.
Still playing with data grids and have discovered another issue with the way the data is presented on my form. I've created a data entry stack which has a field called description in it which is approximately 400 wide and 300 in height. When I type a long word, during testing I am using random characters for testing without a space and the word exceeds the 400 pixels wide limit. I am expecting the word to wrap around onto the next line, but it doesn't. Nevermind, I think that once I dispatch the data to the dgtext in the data grid, the description label will wrap it as I have other fields/labels on the template but unfortunately the label field here just allows the text to overflow and overlap the other fields on my data grid form.
Is there anyway I can force the text to wrap around in the form, I'm trying to prevent the overlapping of fields on my layout.
Thanks as always.
Re: Force text to wrap around in a data grid form?
Hi jalz,
It would be easier to try to figure out solution if you post the stack as well.
keram
Did you place it properly in the Row Template design?jalz wrote:I have other fields/labels on the template but unfortunately the label field here just allows the text to overflow and overlap the other fields on my data grid form
It would be easier to try to figure out solution if you post the stack as well.
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: Force text to wrap around in a data grid form?
Hi Keram,
I've knocked together a simple file here. If you press on the New button, you should see an input screen with two fields, description and price. Enter values in both fields, but if you type in a long word in the description box (i.e. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz) without a space, I would expect the word to wrap around in the description box but it seems to continue scrolling to the right. Whats more important is on save, the value is dispatched to the datagrid and the value seems to overlap the price field, when I would prefer it if the field in the data grid displayed as much as the field defined by the width.
Thanks
Jalz
I've knocked together a simple file here. If you press on the New button, you should see an input screen with two fields, description and price. Enter values in both fields, but if you type in a long word in the description box (i.e. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz) without a space, I would expect the word to wrap around in the description box but it seems to continue scrolling to the right. Whats more important is on save, the value is dispatched to the datagrid and the value seems to overlap the price field, when I would prefer it if the field in the data grid displayed as much as the field defined by the width.
Thanks
Jalz
- Attachments
-
- mygrid.livecode.zip
- (4.71 KiB) Downloaded 195 times
Re: Force text to wrap around in a data grid form?
Hi jalz,
I have made changes so that you can get this display: 1. to get the line like the one with price 150 is simple and quick:
put this line: put item 3 of pControlRect - 99 into item 3 of theFieldRect
into LayoutControl, you had much smaller number than 99
2. to get the description wrapping like in the lines with prices 103 and 105 (I split the huge line that you used since it's not realistic anyway)
have a look at this lesson:
http://lessons.runrev.com/s/lessons/m/d ... ne-heights
keram
I have made changes so that you can get this display: 1. to get the line like the one with price 150 is simple and quick:
put this line: put item 3 of pControlRect - 99 into item 3 of theFieldRect
into LayoutControl, you had much smaller number than 99
2. to get the description wrapping like in the lines with prices 103 and 105 (I split the huge line that you used since it's not realistic anyway)
have a look at this lesson:
http://lessons.runrev.com/s/lessons/m/d ... ne-heights
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: Force text to wrap around in a data grid form?
Hi Keram,
That seemed to do the trick for my example file. Now I'm going to try and apply it to my real stack - I've still got a lot to learn, these datagrids are making me pull my hair out!
Cheers
Jalz
That seemed to do the trick for my example file. Now I'm going to try and apply it to my real stack - I've still got a lot to learn, these datagrids are making me pull my hair out!
Cheers
Jalz
Re: Force text to wrap around in a data grid form?
Hi jalz,
Best
Klaus
welcome to the club!jalz wrote:... these datagrids are making me pull my hair out!

Best
Klaus
Re: Force text to wrap around in a data grid form?
Hi Jalz,
There are just few people that have mastered data grids. One of them is Zryip TheSlug who actually created a Data Grid Helper http://www.aslugontheroad.com/ - a plugin for LiveCode but only LC Commercial version so I was not able to try it. Zryip says that he is working on another version that will run on LC Community.
I know that Terry (TerryL) is preparing a nice stack with useful data grid tricks. Hopefully she will post it soon.
keram
Same here, in 5 months I've lost all my hair. See, even the Great Klaus is in the same DG Club!jalz wrote:these datagrids are making me pull my hair out!

There are just few people that have mastered data grids. One of them is Zryip TheSlug who actually created a Data Grid Helper http://www.aslugontheroad.com/ - a plugin for LiveCode but only LC Commercial version so I was not able to try it. Zryip says that he is working on another version that will run on LC Community.
I know that Terry (TerryL) is preparing a nice stack with useful data grid tricks. Hopefully she will post it soon.
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit