I have two columns that contain a date/time value in a TAdvColumnGrid.
I set the editor to edDateTimeEdit as the manual states.
The manual states I can use grid.DateTimePicker to set properties of a datevalue, but I want to edit them both at once. The manual says something about a special purpose editor, but does not mention how to get to its properties.
As there is no way to add TDateTimeValues at once, I did this:
Grid.Dates[nKol, nRij] :=tijdstipvan;
Grid.Times[nKol, nRij] :=tijdstipvan;
Grid.Dates[nKol, nRij] :=tijdstiptm;
Grid.Times[nKol, nRij] :=tijdstiptm;
When I look at the grid the columns only show the time.
What do I do wrong?
In the code the third and fourth row have to have a columnvalue of nKol + 1.
I was expecting the grid to display date and time correct when I choose the right editor. The editor itself works ok, but it is just not displayed the right way.
Am I correct that it is not possible to have the grid display date and time in one column?
The question again, but then shorter:
How do I fill the cells with the right date/time value?
Not by using Grid.Times[] and Grid.Dates[]
Or: how do I get the Grid to dispay date and time in one column?
You can do this with:
advstringgrid1.Cells[Col,Row] := FormatDateTime(FormatSettings.ShortDateFormat + ' ' + FormatSettings.ShortTimeFormat,Now);
and edit this value with edDateTimeEdit inplace editor type.
But, we'll facilitate this in the next update with direct access via a property:
grid.DateTimes[Col,Row]: TDateTime
Thank you, that feature is highly appreciated!
Last question: Is there a way to edit the date/time in a popup window? The editor is quite large now and a window, like the one used for memo's, is very handy. I have read the piece about TEditLink, but I'm not sure how to start. And maybe there is something for this already.
There is no such special editor built-in. You'd need to build a custom inplace editor for this.
A starting point for this is: