[IronPython] WPF DataGrid bug

Lukas Cenovsky cenovsky at bakalari.cz
Fri May 14 00:04:13 CEST 2010


Hi all,
when working with DataGrid in WPF application, I have found two bugs. I 
am not sure they are IronPython bugs but I don't know how to investigate 
more - I am not so fluent in WinDbg :-)

The first (more severe) bug is the /Object reference not set to an 
instance of an object/ error. The attached sample consists of DataGrid 
with some items and property /sel_item/ that is bound to 
DataGrid.SelectedItem. When you try to disable the whole DataGrid (click 
the button), the /Object reference not set to an instance of an object/ 
appears:

Traceback (most recent call last):
  File "C:\IronPython-2.6.1\wpf.grid.py", line 109, in <module>
  File "C:\IronPython-2.6.1\wpf.grid.py", line 103, in btnClick
SystemError: Object reference not set to an instance of an object.>>>

It only appears when you use binding to DataGrid.SelectedItem. If you 
remove the binding (lines 21-22; in xaml), no error appears.

The second error appears when you initialize /sel_item/ to None (change 
line 73 to: self.sel_item = None). The DataGrid has initially no 
selected row. When you click on any, the binding error appears:

TypeConverter cannot convert from DataItem.

I guess this is more likely to be correct behavior because the Binding 
is initialized with None instead of the row type so it has no way to 
find out the right conversion.

I use IronPython 2.6.1 and WFP Toolkit from February 2010.

It would be nice if somebody could check these bugs.  Thanks.

--
-- Lukáš
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100514/7937dd5f/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wpf.grid.py
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100514/7937dd5f/attachment.ksh>


More information about the Ironpython-users mailing list