def OnButtonApply(self, event):
        """Updates the preview_textctrl"""

        try:
            dialect, self.has_header = self.csvwidgets.get_dialect()
        except TypeError:
            event.Skip()
            return 0

        self.preview_textctrl.fill(data=self.data, dialect=dialect)

        event.Skip()
Updates the preview_textctrl