dgb
asked on
DataGridView CurrentCell.EditType
I want to know if the inline editor of my cell in a DataGridView is of the type DataGridViewTextBoxEditing Control.
I would like to know why I can't use this:
?CurrentCell.EditType Is DataGridViewTextBoxEditing Control
'DataGridViewTextBoxEditin gControl' 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 DataGridViewTextBoxEditing Control).G etType
True
This probably will give me a lot of garabage collection.
I also could use this:
?CurrentCell.EditType.Name = "DataGridViewTextBoxEditin gControl"
True
But I try to avoid this practice for obvious reasons (casing can change).
Why can I not use:
?CurrentCell.EditType Is DataGridViewTextBoxEditing Control
It seems like a good idea.
What should I use instead as best practice?
I would like to know why I can't use this:
?CurrentCell.EditType Is DataGridViewTextBoxEditing
'DataGridViewTextBoxEditin
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 DataGridViewTextBoxEditing
True
This probably will give me a lot of garabage collection.
I also could use this:
?CurrentCell.EditType.Name
True
But I try to avoid this practice for obvious reasons (casing can change).
Why can I not use:
?CurrentCell.EditType Is DataGridViewTextBoxEditing
It seems like a good idea.
What should I use instead as best practice?
ASKER
CodeCruiser thank you for your response.
I tried it and I get an error message:
?CurrentCell.EditType Is TypeOf(DataGridViewTextBox EditingCon trol)
'Is' expected.
I tried it and I get an error message:
?CurrentCell.EditType Is TypeOf(DataGridViewTextBox
'Is' expected.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
?CurrentCell.EditType Is TypeOf(DataGridViewTextBox