Hello support staff,
I have been using your DevExpress grid for many years. Recently i have attempted for the first time to use a TcxEditRepositoryTimeItem in one of our grid's columns but are having some problems with it. Here are the steps I have taken so far...
I have added into a EditRepository component the TcxEditRepositoryTimeItem. The resulting item has been assigned to one of my column's Repository value... i.e. grid.GridView.Columns.RepositoryItem := cxEditRepository1TimeItem1;
I have used the very similar Datetime repository items in other columns with no problems. When I set one of the column's cells with a double value, the Datetime component accepts it and renders a readable date and time. If i do the exact same style of assigning a double value to a cell in the TimeItem column, all that is shown is the double value. It is not repainted as a value such as "12:30 AM". When my form is first created and the grid is being populated, if the initial double value happens to be 0, the cell paints a "12:00 AM" as expected. Any other value doesn't seem to do so.
In my attempts to solve this issue, i have also tried to do a direct assignment to the Time variable of the component. i.e. TcxCustomTimeEdit.Time. The help file says it is as simple as reading or writing to the Time property. It is not readily or easily available through the TcxEditRepositoryTimeItem, so i tried code such as...
Doing things this way always results in an access violation in the component's SetTime function. I am assuming the typecasting is somehow incorrect or something like that.[Delphi]
TcxCustomTimeEdit(grid.GridView.Columns.RepositoryItem).Time := (a double value);
So my question boils down to... After adding the TcxEditRepositoryTimeItem into a column, what is the necessary way to read and write to that cell? How do I access the Time property correctly from the Repository Item without a crash? A small sample code would be great.
Thank you for your time,
Prediction Software Inc.
I've attached a small test project, which demonstrates how to correctly set values to a data-aware GridView (via the DataSet and DataController). Please take a look at it. I believe this will help you to resolve the issue you faced.
P.S.: Please use code brackets for writing your code in the Question and Answer sections. This will highlight your code parts and make your posts look clearer. As a result, we will be able to process your inquiries faster.