Hi
Is it possible to have have different field types in the same grid column?So for example column 1 row 1 I need a numeric entry (using the XamNumericEditor as the EditorStyle) and column 1 row 2 I need a DateTime field (using the XamDateTimeEditor as the EditorStyle)
The problem seems to be when setting the Field.EditAsType property, if it's changed to "typeof(decimal)" then it'll clear all values in the column which can't be converted to decimal so my entered DateTime values in that row get cleared.
Any ideas?
Rgds
M
Excellent, that works perfectly !!
Many thanks for your help Alex.
Hello,
The XamDataGrid will generate by default editors of the same type for the whole field's cells. So, if you have set the EditAsType, EditorStyle or EditorType properties you explicitly set the type of editor that will be used for that field. One thing that you can do go achieve what you want is to use the InitializeRecord event. This will fire for all the records and you can change the Editor settings through the cell instance, like this:
(e.Record as DataRecord).Cells[0]...
Let me know if you have questions on this. If you still have troubles, I will be happy to attach a sample project illustrating this.
Just a random thought (and I am by no means an expert here)... I wonder if some hidden data in any given row could specify a EditorType to use and then you could bind the actual field EditorType to that data.
Thanks.