Data grid display

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
lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Data grid display

Post by lemodizon » Mon Jul 26, 2021 1:56 pm

Hi everyone,
This is my first time I encountered this in the data grid in livecode. Every time I saved the product description ( i just copied the data from the excel file) the display on the data grid it separate the other information. I don’t know if the data grid or the text field I will configured. hope you can help me thanks in advance.
c1.JPG
c1.JPG (17.1 KiB) Viewed 2288 times
After I saved the information, it displays like this.
c2.JPG
But when I checked my database, it seems ok coz all the data were stored properly.
c3.JPG
but when I tried to encode the data from the excel file it seems ok.
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Data grid display

Post by Klaus » Mon Jul 26, 2021 2:21 pm

Hi lemodizon,

sorry the last two images are just to small to see what's going on.

But I suspect that there are RETURN/CRs in the "Product description"!
That will cuase the Datagrid to think these are new records and displays them in a new line
The Datagrid of type TABLE is only meant for displaying ONE line in its fields!

So just replace the CR with COMMA or any other character as delimiter other than TAB in the product description and that should do the trick.


Best

Klaus

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Data grid display

Post by stam » Mon Jul 26, 2021 2:46 pm

What Klaus says (as always!)

If the text you're copying has a CR and/or LF in it, it will be treated as a new line of data instead of a cell with multiple lines.

You'd need to replace the 'return' in the text of the cell you want to copy with a character you can easily search for and replace and which won't be used for anything else, eg "§"

You can actually just leave the text like that but in fillInData hander convert it the "§" back to return when passing data to that field. Personally as i prefer to work with arrays, i'd convert that back on building up the array - then you don't have to worry about returns in your text for each cell...

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: Data grid display

Post by lemodizon » Mon Jul 26, 2021 3:27 pm

Klaus wrote:
Mon Jul 26, 2021 2:21 pm
Hi lemodizon,

sorry the last two images are just to small to see what's going on.

But I suspect that there are RETURN/CRs in the "Product description"!
That will cuase the Datagrid to think these are new records and displays them in a new line
The Datagrid of type TABLE is only meant for displaying ONE line in its fields!

So just replace the CR with COMMA or any other character as delimiter other than TAB in the product description and that should do the trick.


Best

Klaus
Hi Klaus,

thanks it works. thanks for the information "that table on data grid meant for displaying ONE line in its field" I didn't know this. thanks again have a nice day.
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: Data grid display

Post by lemodizon » Mon Jul 26, 2021 3:33 pm

stam wrote:
Mon Jul 26, 2021 2:46 pm
What Klaus says (as always!)

If the text you're copying has a CR and/or LF in it, it will be treated as a new line of data instead of a cell with multiple lines.

You'd need to replace the 'return' in the text of the cell you want to copy with a character you can easily search for and replace and which won't be used for anything else, eg "§"

You can actually just leave the text like that but in fillInData hander convert it the "§" back to return when passing data to that field. Personally as i prefer to work with arrays, i'd convert that back on building up the array - then you don't have to worry about returns in your text for each cell...
Hi Stam,

Thanks for the post I will try this also fillInData handler. I also need to learn on how to use arrays in livecode it's in my list. thanks again have a nice day.
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”