[wxPython] How to set whole column or Row as Readonly in wxGrid

In wxGrid, I like to set whole row or column as
Readonly. There are properties to set individual cell
as readonly (setReadonly) or entire grid as readonly
(SetEditable), but are they any properties to set
individual rows or columns as readonly or we have to
loop through each cell individually and setting them
read only?

···

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

You can define an instance of a wxGridCellAttr and set its attributes
however you wish, eg:

        self.ro_attr = wxGridCellAttr()
        self.ro_attr.SetReadOnly(1)

You can then apply this per row or per column as required, eg:

        for row in range(nitems, self.GetNumberRows()):
            self.SetRowAttr(row,self.ro_attr)
            self.ro_attr.IncRef()
        self.SetColAttr(3,self.ro_attr)
        self.ro_attr.IncRef()

You have to manually increment the reference count each time you use the
instance (according to advice received here from Robin a few weeks ago).

Regards,

David Hughes
Forestfield Software Ltd
www.forestfield.co.uk

···

-------- Original Message --------

In wxGrid, I like to set whole row or column as
Readonly. There are properties to set individual cell
as readonly (setReadonly) or entire grid as readonly
(SetEditable), but are they any properties to set
individual rows or columns as readonly or we have to
loop through each cell individually and setting them
read only?