Changeset 4219

Show
Ignore:
Timestamp:
06/30/08 20:22:36 (2 months ago)
Author:
ed
Message:

Fixed a problem when using columns with a 'list' data type reported by Adrian Klaver.

Also fixed a bug in the removeColumn() method that didn't correctly trap a missing column.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dGrid.py

    r4217 r4219  
    974974    def _setDataField(self, val): 
    975975        if self._constructed(): 
     976            if self._dataField: 
     977                # Use a callAfter, since the parent may not be finished instantiating yet. 
     978                dabo.ui.callAfter(self._setDataTypeFromDataField, val) 
    976979            self._dataField = val 
    977             # Use a callAfter, since the parent may not be finished instantiating yet. 
    978             dabo.ui.callAfter(self._setDataTypeFromDataField, val) 
    979980            if not self.Name or self.Name == "?": 
    980981                self._name = _("col_%s") % val 
     
    29592960        else: 
    29602961            # They probably passed a specific column instance 
    2961             colNum = self.Columns.index(col) 
    2962             if colNum == -1: 
    2963                # No such column 
    2964                 # raise an error? 
     2962            try: 
     2963               colNum = self.Columns.index(col) 
     2964            except ValueError: 
     2965                # Column is not in the grid 
    29652966                return 
    29662967        del self.Columns[colNum]