I've taken over a project in Delphi XE4 and I've added some data aware controls to the project. The TDBGrid seems to work fine, but none of the TDBText controls are displaying anything - and it has me stumped. I can throw a TDBEdit on the form and hook it up and it works just fine.
Can anyone think of something that would prevent a TDBText control from working?
Related
I am working on my first multi-platform app for Windows and MacOSX. I decided to go with SQLite, and a StringGrid to check connectivity. I have placed all necessary components on the form from looking at an SQLite Sample that came with Delphi 10.0.
I ran the LiveBindings Wizard connecting my FDTable to the StringGrid just fine. I can activate the table and it displays my data (imported from a BatchMove), see attachment. But when I run the app, connect my FDConnection and my Table, the grid doesn't get populated. What am I missing?
I am facing this problem.
Dataset sometimes lose value at runtime.
I solved this shortcoming with a line of code after the opening of such datasets
BindSourceGPS.DataSet:=TransTable;
Grigore
Sorry folks. Answered my own question. I had everything on a Dataform and that was being created first. I thought I had it running, but all of the examples I was looking at the data components were kept on the main form. And since I can hide non-visible components, I moved everything to the main form.
But, I forgot to change the form creation order. Moved the main form to be created first and Whala. Everything is working. Still not sure why having the data components and livebinding on separate forms worked in preview but not while running, but everything on one form, created first works just fine for me.
I have created a Tframe unit with visual and DB controls. I registered the frame as a component using the sprig approach. The TFrame has a few published boolean properties.
Everything works OK, except I have noticed that if I start the IDE and open a project that uses that component, the IDE complains about the "unknown" published properties. And if one looks at the DFM, Delphi has changed the definition for the frame within the form it is embedded in from "object ..." to "inline ...". If I just close the project, without saving, and re-open it, all is good.
It only happens on the first project open.
Any suggestions would be appreciated.
The thing here is that registering a TFrame does work, but publishing properties almost always does not. I say "almost always" as i had this kind of issue in the past (Delphi XE2 as far as i remember) and there seems to be a bug in the designer deeply hidden somewhere. Debugging this issue gave me no results back then.
I suggest you simply move the published properties to public and set these properties in source code directly. This is a workaround but it works.
If I try
ListView1.items[0].EditCaption;
it works as expected allowing me to edit the first items caption, however if while editing I try
ListView1.items[0].CancelEdit;
It does not cancel the editing. Is there some concept I'm missing, is it a bug, or is the help wrong?
This seems to be a problem in Delphi 2007 and XE2 (and probably others).
I think this is a problem with the native control, the VCL does as documented (calls ListView_EditLabel(Handle, -1);), but to no effect. According to the documentation of ListView_GetEditControl, sending the list view a WM_CANCELMODE should also work, which it doesn't.
A test here shows the below works,
winapi.windows.SetFocus(ListView1.Handle);
interestingly ListView1.SetFocus doesn't.
I have upgraded an old project from Delphi 7 to Delphi XE.
The project has (among others) some THotKey controls. Under Delphi 7 the THotKey controls are working ok. But under Delphi XE they are like disabled. This means that they show nothing inside even if a shortcut (Alt+A for example) is assigned to them and I cannot edit them.
Anybody else has this issue?
Update:
I deleted ALL controls and all code from that project. Now I have ONLY the main form and a single THotKey control. Basically, after deleting all the controls my project is like a brand new created project without a single line of code. But the THotKey is still not working under Delphi XE and still works under D7.
Cause found (Delphi bug)
I compared my project with a new created project. I have seen that the old form had the 'double buffering' option set while in the new project this was not on, so I manually turned off this option in my old form. Guess what? The THotKey works!!!!!!! Every time I turn the 'double buffering' on, the THotKey goes ape.
Confirmed
Yes (by Andreas Rejbrand)
Solution (partial):
I have seen that it is not actually main form's DoubleBuffered property that causes this but rather THotKey's. So it is enough to turn off this property for THotKey, not for entire form. I think I can leave with that.
:)
I'm using Tortoise SVN with Delphi 7 and I always have to check the dfm before I commit... but I have a Delphi 7 DFM which has somehow lost it's FormCreate and FormShow event handles! I know that moving the form inside the Delphi IDE causes the dfm to be modified (Top, Left.. etc), but I highly doubt that I removed the event handles manually... so I'm wondering if anyone has experienced anything like this before. Please share your experience. Thanks.
It sometimes happens, but do not know why. Mostly when using frames or inherited forms, and opening/changing a subframe/subform without opening the forms that use it. Or something like that... Cannot reproduce it, but weird indeed.
I have used Delphi for many years and it has never happened to me, but if the code is still there you could just double click on the event (FormCreate and FormShow) and they will be assigned again.
I have experienced this when initially sketching out the method and event structure. If I generate event handles, then move on and compile or run the program with an empty event holder, then CodeComplete will remove the empty handler. I have not encountered this problem in situations where the event handler is non-empty.