Using Ultimate 15.1
I have afield that needs to be a regular edit control (Default - free entry text) or a dropdown list based on other data.
So I want to toggle on the fly based on After Cell Update. I am using a Row Edit Template (so it is in a form with the Arrow showing). As I toggle between display styles, the Combo Box arrow remains. I want to hide the arrow if it is suppose to be Default.
Not sure how to do this. I tried setting the ValueList to null but it threw exception. The behavior is correct except for the arrow in terms of enabling the edit portion but I want to regenerate the control so the combo box arrow (dropdown arrow - combobox arrow) disappears.
The 'Default' constant does not necessarily mean the column will use a text editor; other criteria is used to determine which editor is most appropriate, such as the data type or, as is the case here, whether the ValueList property is explicitly set. In that case, the EditorWithCombo will be used.
I know it isn't the most discoverable name ever given to a constant, but the name of the ColumnStyle constant you're looking for is named 'Edit'.
That said, I don't think you will get away with doing this in AfterCellUpdate...you might want to use AfterRowDeactivate instead.
AfterRowDeactivate?
I tried setting to "Edit" and it crashed. I also tried setting ValueList to null and it crashed.
I want to dynamically change the cell not on row deactivate (want it done based on data from another field => value in another field needs to trip the style after it is changed). I want to remove the dropdown based on other data. I would assume there must be a way of doing this, I just haven't found it yet.
There is a fudge method of having two fields overlapping and hide one or hide the other based on the value of the other field.
aka, add a field called FieldCombo and another called FieldEdit and hide or show based on the value of the other field although this should work, it is really a hack by creating two fields to represent a single field. After edit of the one field, it simply pushes it back to the dataset associated to the grid.
I was hoping for a simpler solution but I will go with this HACK which will work...
I was recommending AfterRowDeactivate based on the premise that your application will not crash if you switch the style in that event.
As it happens, I am not able to reproduce the crash you're getting when you set the column's Style to 'Edit' in response to AfterCellUpdate.
I attached a sample project that demonstrates this; ideally you will be able to change this one so that it is reproducible, or provide a different one that replicates the problem.