wx.DataViewCtrl refill

hello, I’m trying to use wx.DataViewCtrl to view a database table. I’ve put the wx.DataViewCtrl in a sash layout and when the user wants to view the content of another table I have to change columns and content. What is the orthodox way to accomplish this? I’ve tried with maysash.RemoveChild(mydataviewctrl) and then create another one but it doesn’t seem to work correctly (maybe because of the associated model).

thanks in advance for suggestions

Marco

I think I’ve solved:

  • create mydataviewctrl with an empty model
  • everytime I want to view a recordset:
    – fill data in the model
    – mydataviewctrl.ClearColumns()
    – recreate columns as needed
    – mydataviewctrl.Reset(len(mydataviewctrl.model.data))
···

On Wednesday, September 12, 2012 12:42:20 PM UTC+2, Marco Prosperi wrote:

hello, I’m trying to use wx.DataViewCtrl to view a database table. I’ve put the wx.DataViewCtrl in a sash layout and when the user wants to view the content of another table I have to change columns and content. What is the orthodox way to accomplish this? I’ve tried with maysash.RemoveChild(mydataviewctrl) and then create another one but it doesn’t seem to work correctly (maybe because of the associated model).

thanks in advance for suggestions

Marco