Dear Sirs,
I would like to know if there is a way to change the default editors for a DataLayoutControl in runtime. What I mean is that for example we have integer fields in our db but we want the editors to be TextEdit and not the default SpinEdit is that possible in runtime ? I have seen an example of changing the textedit to a memoedit but this is not what we need. We need to change the default editor and not to change the editor after it has been created.
Thank you in advance
We have closed this ticket because another page addresses its subject:
RetrieveFields() - type --> editor mapping
Hello Manolis,
Thank you for the question. To achieve this goal you will need to manually create the required editor and add it to the form. Please review the RetrieveFields() - type --> editor mapping thread in which this task has already been discussed.
Thanks,
Stan.
Thank you for your answer.
So there is no way to let the datalayoutcontrol understand that when it finds a for example integer field in the db to use a TextEdit instead of a SpinEdit. I have to manualy change it after i retrieve the fields using the name of the field (which is not what we need). We need to use the type of the field to specify the editor. Is that correct or I have missed some point somewhere ?
Thanks again
Hi,
There is no special functionality. You should use a workaround from the RetrieveFields() - type --> editor mapping thread. Another solution is to create a DataLayoutControl descendant and override two methods:
CreateControlsManager and GetSuggestedControls.
Thank you, Marina
Thank you for your answer again.
I was thinking too about the second solution you provided. Could you give me an example ?
Hi,
I've attached my sample. Let me know if you need further assistance
Thank you, Marina
Dear Marina,
First of all sorry for the dalay. Second thank you very much for your time and example …this was what I needed.
solved