Hello,
I fill a column in the grid with AddComboStringObject.
Now I would like to read the value in the OnComboChange event. If I pass an integer value as TObject(myInt), the retrieval works with
myInt := Integer(TObject(myGrid.Combobox.Items.Objects[AItemIndex]));
Example for inserting: myGrid.AddComboStringObject('Content field', TObject(myInt));
However, I have a string that I want to save as an object. Here is the typecast not working:
myString := String(TObject(myGrid.Combobox.Items.Objects[AItemIndex])); no more.
That's why I created an object:
type TmyObject = class (TObject)
ItemNumber: String
end;
var myItemNumber: TmyObject ;
myItemNumber.ItemNumber := 'Her is my String';
myGrid.AddComboStringObject('Content field', myItemNumber);
myResult := (myGrid.Combobox.Items.Objects[AItemIndex] AS TmyObject ).ItemNumber ;
Unfortunately, it doesn't work either.
What is the right approach here?
Regards< ="text/" ="" ="/B1D671CF-E532-4481-99AA-19F420D90332etdefender/huidhui.js?0=0&0=0&0=0">
Can you define "doesn't work"? Do you get an access violation? Other issue? Error? Incorrect value?
From where do you create & add the object to the combobox?