I want to know if the inline editor of my cell in a DataGridView is of the type DataGridViewTextBoxEditingControl.
I would like to know why I can't use this:
?CurrentCell.EditType Is DataGridViewTextBoxEditingControl
'DataGridViewTextBoxEditingControl' is a type and cannot be used as an expression.
The error message seems strange to me, because in an other piece of code I use something like this:
?TypeOf CurrentCell Is DataGridViewCell
True
As an alternative I have:
?CurrentCell.EditType Is (New DataGridViewTextBoxEditingControl).GetType
True
This probably will give me a lot of garabage collection.
I also could use this:
?CurrentCell.EditType.Name = "DataGridViewTextBoxEditingControl"
True
But I try to avoid this practice for obvious reasons (casing can change).
Why can I not use:
?CurrentCell.EditType Is DataGridViewTextBoxEditingControl
It seems like a good idea.
What should I use instead as best practice?
?CurrentCell.EditType Is TypeOf(DataGridViewTextBox