wxPython wx.grid.Grid resizing

I’m trying to use wx.grid.Grid to show a database, and I’m using GridBagSizer to make up the layout.

The problem is: When resizing the window, the wx.Grid stretches out as far as it can and fill all the vertical space.

The code for the grid is actually the same as in wxPython demos, just the data is changed.

the layout part:

    def InitUI(self):
self.MainPanel = wx.Panel(self, -1)
vgap = hgap = 5
sizer = wx.GridBagSizer(vgap, hgap)
self.myList = DBTable(self.MainPanel)
sizer.Add(self.myList, pos = (0, 10), span = (5, 10), flag = wx.EXPAND)
sizer.AddGrowableRow(0)
sizer.AddGrowableCol(10)
self.MainPanel.SetBackgroundColour('BLUE')
LeftPanel = wx.Panel(self.MainPanel)
LeftPanel.SetBackgroundColour('BLACK')
BottomPanel = wx.Panel(self.MainPanel)
BottomPanel.SetBackgroundColour('RED')
sizer.Add(LeftPanel, pos = (0, 0), span = (5, 10), flag = wx.EXPAND)
sizer.Add(BottomPanel, pos = (5, 0), span = (6, 20), flag = wx.EXPAND)
self.MainPanel.SetSizer(sizer)

I posted some screenshoots:

http://i.stack.imgur.com/v2hRz.jpg

http://i.stack.imgur.com/Sfu6d.jpg