So I'm trying to make a subclass of DataGridViewColumn, which has both a no-argument constructor, and a constructor that takes one argument, which expects type DataGridViewCell. This is my class:
class TableColumn(DataGridViewColumn):
def __init__(self, string):
super(TableColumn, self)
self.Text = string
self.CellTemplate = DataGridViewTextBoxCell()
self.ReadOnly = True
Whenever I try to pass in a string as the argument like such:
foo = TableColumn('Name')
It always gives me this:
TypeError: expected DataGridViewCell, got str
So it seems that it's always passing 'string' to the single-argument constructor of the superclass. I've tried replacing super(TableColumn, self) with super(TableColumn,self).__init__() to be explicitly sure that I want to call the no-argument constructor, but nothing seems to work.