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

Gennadiy Donchyts don at env.com.ua
Thu Nov 17 13:45:15 EST 2005


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


More information about the Gtk-sharp-list mailing list