tdbf/dbgrid date field problem lazarus / 16-Databases ---------------------------------------------------------------------- ledster · 2012-10-10 14:34 Strange problem Lazarus 1.0 32 bit, Win 7 home premium 64 bit, i5 4 core, 4 gig memory, ati radeon hd graphics. Using tdfb and dbgrid. Database has date field, several numeric fields and 5 text fields (sizes 1, 3, 4, 20 and 30). Problem is entering dates in the date field. Add a new record (or edit an existing one) date is first field and entry goes normally. Move to next field (text, size 1), realise date is wrong and return to date field - program will only let me enter 1 character. If I don't realise my mistake until I am in the 3 character text field, mouse click back in the date field, program will only let me enter 3 characters. Pattern appearing? Move from 4 character field to date field, max characters is now 4! Of course if I move back (direct) from the 20 or 30 character fields, no problem. Grid column widths are all set at default min 10, max 200. Changing these has no effect. tdbf display widths are 10 for date field and 1, 3, 4, 20 etc for the other fields. I tried putting this in grid oncolenter: code   If DBGrid1.SelectedIndex = 0 Then   Begin     DBGrid1.Columns[0].Field := dbf1tofrom; // (size 20)      DBGrid1.Columns[0].Field := dbf1chkdate;   end; \code Also tried code   If DBGrid1.SelectedIndex = 0 Then     dbf1chkdate.displaywidth := 10; \code neither worked. However putting 2 buttons on form and putting DBGrid1.Columns[0].Field := dbf1tofrom; in one and DBGrid1.Columns[0].Field := dbf1chkdate; then pressing button 1 followed by pressing button 2 does work. Weird. Anyone any ideas? ---------------------------------------------------------------------- ledster · 2012-10-15 13:43 After several hours trying various things to make this work, I decided to carry out a troll in the bug tracker area. Took a while, but I found a similar problem in bug report number 0022789 dated mid September this year (i.e. after Lazarus 1.0 was released). Downloaded dbgrids.pas.diff file, opened it and incorporated the update into my dbgrids.pas file, carried out a build, then ran my project. PROBLEM SOLVED!!! ---------------------------------------------------------------------- BigChimp · 2012-10-15 16:18 Excellent, thanks for the hard work! Now please let us know which bug that was so we can try and get that fixed - if it hasn't already been fixed ---------------------------------------------------------------------- Zoran · 2012-10-15 18:16 Quote from: BigChimp on October 15, 2012, 06:18:15 pm... Now please let us know which bug that was ... You should read Ledster's post more carefully. Quote from: ledster on October 15, 2012, 03:43:26 pm... in bug report number 0022789 dated ... Quote from: BigChimp on October 15, 2012, 06:18:15 pm... if it hasn't already been fixed They say it is fixed in trunk... But I don't think this patch got backported to 1.0.2. ---------------------------------------------------------------------- BigChimp · 2012-10-15 18:45 Thanks, Zoran! Quote from: Zoran on October 15, 2012, 08:16:52 pmQuote from: BigChimp on October 15, 2012, 06:18:15 pm... Now please let us know which bug that was ... You should read Ledster's post more carefully. Quote from: ledster on October 15, 2012, 03:43:26 pm... in bug report number 0022789 dated ... Oops, sorry, yes, you're right. My apologies, Ledster... ---------------------------------------------------------------------- Zoran · 2012-10-15 21:06 Quote from: BigChimp on October 15, 2012, 08:45:04 pmThanks, Zoran! You are welcome! ---------------------------------------------------------------------- ledster · 2012-10-16 08:21 No apology needed! Hope this topic helps others.