[Gtk-sharp-list] Editable DataGrid.
Tue, 14 Oct 2003 15:56:28 -0300
I'm trying to write an "Editable Datagrid" control.
It is a class that inherit from ScrolledWindow...
Inside it have a Table Object an in all of this cells it have some Entry and
other checkButton and other Combo.
I make somethink that simulate databinding. It have a property that is
datasource, that takes DataTable Object.
It is somethink like this.
GridColumnsCollection Columns // A custom collection that have columns
datasource = value;
In this method i create all Columns and define some styles..
Here i resize the table (that is the container) and add the entry,
combo or checkButton.
// This class is an item for GridRowsColumnsCollection
public GridRowsCollection Rows
// This is an item for GridRowsCollection
Object contained; // this is the Entry, Combo or checkButton for the
To do some "real" databinding, i need to set the new value to DataTable
(datasource) when is changed. This make me add an Event to the Object
(Combo, Entry or CheckButton). I'm using FocusedOut Event from Widget
My problem is that i dont know how to reference to the Row Object (the
container row) for the Entry that pass the event.
The only way that i think is to create another class that inherit Entry (in
case that entry is the choice) that have another property that reference to
row Index. Is this correct? it is posible to do in other way?
Sorry if you don't understand my pseudo-code i can explain more.
Thanks in advance
Charla con tus amigos en línea mediante MSN Messenger: