Max number of columns in a datagrid?

Bob Sneidar bobsneidar at iotecdigital.com
Mon Nov 26 19:06:33 EST 2018


I read it. :-) My original question was simply, how many columns can a datagrid have? In other words is there a limit? The reason it mattered to me at the time was because I was importing a csv file with a lot of columns and it was easier for me to set the dgProp ["columns"] to the first line of the file, and the dgText [true] to the whole file. Down and dirty, no looping to grab just the pertinent data. 

The problem was that one of the file formats exported by the copier had way too many columns, so if I was going to use that file, I was going to have to preprocess the file. Also, I was concerned because I didn't just fail to set the detect, I KILLED the datagrid object and had to delete it and create a new one. That could present a problem for anyone trying the same thing in an app in the future. Think importing complex spreadsheets. 

Now I've decided not to use that file, but another one I can get from the copier and that is far less granular. I don't even need to use a datagrid, but it happens to be a really handy way to convert a csv file to an array without having to write my own code to do it. :-) Plus, I can show the end user something to indicate that I have the data, and allow them to peruse it and even get stats for a particular selected row. 

I did not intend for this thread to become a debate on how datagrids should work. I love the fact that we even have them! Just to be clear how fundamental I think a real table object is, where row and column data can be referenced like a spreadsheet, the only reason I have gon on to develop in Livecode is due almost exclusively to the datagrid. 

Bob S


> On Nov 26, 2018, at 15:04 , Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Few read what I write here, so this will likely be as lost as the last time I addressed this a couple days ago.  But I'm just OCD enough to keep trying, so here goes:
> 
> 
> A field is a single control.
> 
> A DataGrid is many hundreds of countrols, many of which are fields.
> 
> The DG is a good option where you need the unprecedented flexibility it provides with form layouts.
> 
> For everything else using a single control, the engine-native field object, will outperform because all the processing needed to render the contents happens in highly-optimized machine-compiled C++.
> 
> Try the field object.
> 
> Really.
> 
> I don't keep writing this to mislead.





More information about the use-livecode mailing list