[IronPython] get_Item in subclass

William Reade william at resolversystems.com
Mon Dec 19 18:42:54 CET 2005


We've been having some problems subclassing the SyncFusion Grid control 
with IronPython; namely, that:

class TestGridControl(GridControl):
    pass

grid = TestGridControl()
value = "foobar"
grid[1, 1].CellValue = "foobar"

fails with the following stack trace:

Unhandled exception: Bad args for the method <method# get_Item on 
Syncfusion.Windows.Forms.Grid.GridControl>   at 
IronPython.Objects.ReflectedMethodBase.TryCall(Object[] args, Object& ret)
   at IronPython.Objects.ReflectedMethodBase.Call(Object[] args)
   at IronPython.Objects.Ops.Call(Object func, Object[] args)
   at IronPython.Objects.DynamicType.__getitem__(Object self, Object index)
   at IronPython.Objects.Ops.GetIndex(Object o, Object index)
   at 
FunctionalTests.UnitTests.CellUtilsTest.testSetCellValue$f222(Object self)
 in 
H:\dev\current\resolver-working\trunk\FunctionalTests\UnitTests\CellUtilsTest.py:line 
41

While:

grid = GridControl()
grid[1, 1].CellValue = "foobar"

works as expected.

Has anyone come across this before, and does the list have any bright 
ideas for working around it? It seems to us that there's some magic for 
dealing with the CLR Item property which isn't working quite right in 
subclasses, but that's as far as we've got...

Cheers
William



More information about the Ironpython-users mailing list