wxGrid grid question..

Hi all,

I've got info from a db displaying nicely in a wxGrid,
except that sometimes the data in a particular field can be extremely long. I would like to have the cell's height increase (the whole row), and the text to 'wrap' so that the user doesn't have to click on the cell and scroll until he/she is able to read the whole text.

Is this possible? I thought perhaps wxGrid.AutoSizeRows(true) might be the way but no joy there.

Thanks
Bill.

Bill Witherspoon wrote:

Hi all,

I've got info from a db displaying nicely in a wxGrid,
except that sometimes the data in a particular field can be extremely long. I would like to have the cell's height increase (the whole row), and the text to 'wrap' so that the user doesn't have to click on the cell and scroll until he/she is able to read the whole text.

Is this possible? I thought perhaps wxGrid.AutoSizeRows(true) might be the way but no joy there.

You can use a different renderer for auto-wrap:

         self.SetDefaultCellOverflow(False)
         r = wxGridCellAutoWrapStringRenderer()
         self.SetCellRenderer(9, 1, r)

I don't know if it works nice with AutoSize though, so you'll want to play with that.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!