[Gtk-sharp-list] DataGrid control, data binding, ObjectViews, Swf, Gtk

Gennadiy Donchyts don at env.com.ua
Thu Nov 17 15:00:32 EST 2005


On 11/17/05, Christian Hergert <christian.hergert at gmail.com> wrote:
> The original version of the datagrid i put in monodevelop was taken
> from sqlsharpgtk. Daniel has since done some additions to the
> monodevelop version to support basic editing and deletion. It also had
> support for somewhat of a managed tree model. To be honest, im not
> sure if ive merged that support yet. Both versions are a hack
> regardless.

Thanks for clarification.

> Your example below will not work. First, you cant add an object to a
> gtk container that doesnt inherit from Gtk.Widget. Secondly, even if
> it did work, you would have just doubled your requirements on every
> platform to both gtk and swf.

So the only possible *theoretical* way is probably:

Gtk.Window w = new Gtk.Window();
Swf.DataGrid g = new Swf.DataGrid();

class SwfControl { ... /* make Swf.Control a Gtk.Widget here */ ... }

SwfControl c = new SwfControl(g);
w.Add(c);

I understand that requirements are doubled, but otherwise development
time is also doubled ... probably it would be nice to have them working like
ActiveX work in Swf applications. There are so many nice control libraries
for .NET which look attractive to reuse and not to reimplement.

--Gena


> -- Christian
>
> On 11/17/05, Gennadiy Donchyts <don at env.com.ua> wrote:
> > Hi all,
> >
> > I'm wondering if there is some DataGrid-like control available for
> > Gtk# which has data-binding implemented. For now I've found 2
> > DataGirds in the (1) sqlsharpgtk and (2) MD, which one of these is the
> > latest and will be updated in the future?.
> >
> > Also there is implementation of the (3) SWF DataGrid ...quite complex
> > and still in development but looks very nice also.
> >
> > The question is if will be theoretically possible to use SWF DataGrid instead of
> > Gtk# controls, so to implement something like (Gtk <=> Swf bridge):
> >
> > using Swf = System.Windows.Forms;
> >
> > Swf.DataGrid grid = new Swf.DataGrid();
> > Gtk.Window w = new Gtk.Window();
> > window.Add(grid);
> >
> > Since I need everything to be cross-platform and stable for my application the
> > Gtk# was chosen for gui development. After some play I managed to run a nice
> > test (see below), but then it came to the point when it is necessary
> > to extend it
> > quite a lot (add events, properties, etc.) , so my second question is
> > if someone is
> > already doing or plan to continue development of that class?
> >
> > Best regards,
> > --Gena
> >
> > -----------
> > Test using SqlSharp DataGrid
> > (NHibernate => IList => ObjectViews => (1, Gtk) DataGrid:
> >
> > ...
> > class Project
> > {
> >   private int id;
> >   private string name;
> >
> >   public int ID { get ... }
> >   public string Name { get ... }
> > }
> > ...
> >
> > // load from db into IList using NHibernate
> > IList projects = session.Select(typeof(Project), null);
> >
> > // create object view (ITypedList, IBindingList), see objectviews on sourceforge
> > ObjevtView view = new ObjectView(typeof(Project));
> > view.Columns.Add(new ObjectViewColumn("ID"));
> > view.Columns.Add(new ObjectViewColumn("Name"));
> > view.DataSource = projects;
> >
> > // create and fill project table
> > DataGrid grid = new DataGrid();
> > grid.DataSource = vew;
> >
> > which gives me a nice table with 2 columns :):
> >
> > ID     Name
> > -----------------
> > 1       project1
> > 2       project2
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
>
>
> --
> Christian Hergert
> Medsphere Systems Corporation
> Software Programmer
> C: 253 906 2115
>


More information about the Gtk-sharp-list mailing list