Datagrid problem (extra rows) with a column behavior

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
RBarker
Posts: 5
Joined: Wed Aug 22, 2012 10:39 pm

Datagrid problem (extra rows) with a column behavior

Post by RBarker » Thu Aug 23, 2012 5:54 am

Hi I am a relative beginner to LiveCode and this is my first post so I'm sorry if its in the wrong place. I am stumped with a problem I have with a datagrid. I have a column behavior on one column to change the format. When my datagrid is being populated I have extra rows that shouldn't be there - the rows are blank except for data in the column that I have the behavior added to. The data is a repeat of that column from other rows but I can't figure out why it is being left there. This is the first (and maybe last!) time I've used column behaviors. Has anyone else had this sort of problem. Initially rather than use a column behavior I was attempting to change the format within the datagrid script (I already re-format a date column here but when I added this other column to format also it wouldn't work).
This is the only addition I've made to the behavior for this column to format from XXXXXX to XXXX-XX
on FillInData pData
put char 1 to 4 of pData & "-" & char 5 to 6 of pData into tnewtag
put tnewtag into pData
set the text of field 1 of me to pData
end if
end FillInData

When I sort on any column the data in the 'rogue' rows' column may change to whatever was left there from the previous sort - its like a cleanup needs to be done - where though?
Thanks - I hope this makes sense to someone out there.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Datagrid problem (extra rows) with a column behavior

Post by bangkok » Thu Aug 23, 2012 6:04 am

[quote="RBarker"When my datagrid is being populated I have extra rows that shouldn't be there - the rows are blank except for data in the column that I have the behavior added to..[/quote]

You say that you get extra rows WHEN you populate the datagrid. I think the problem is there.

Your script looks fine to me. Nothing that could create extra ghost rows.

So how and with what data do you populate the grid ?

To be sure : try to populate another grid (whithout any special column behavior) with the same data and the same method.

RBarker
Posts: 5
Joined: Wed Aug 22, 2012 10:39 pm

Re: Datagrid problem (extra rows) with a column behavior

Post by RBarker » Sun Aug 26, 2012 10:52 pm

Hi Bangkok - you were right - is wasn't the column behaviour causing the problem. When I tested on a new datagrid the extra rows still displayed and I could see they were being caused by a unlimited length text field on the SQL file that I am using to populate the datagrid. Thanks for your help - I just couldn't get past the fact that the column behavior was new to me so it must have been that causing my grief! Thanks for your help!

Post Reply