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.
Datagrid problem (extra rows) with a column behavior
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Datagrid problem (extra rows) with a column behavior
[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.
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.
Re: Datagrid problem (extra rows) with a column behavior
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!