Werner666 wrote:
>
>
> [code]
> TreeIter iter;
> TreeModel model;
>
>
> TreePath path = ((TreeSelection)sender).GetSelectedRows();
> this.klantListStore.GetIter(out iter, path[0]);
> Console.WriteLine(path[0]);
>
> klantListStore.Remove(ref iter);
> [/code]
>
The Exception is in the OnButton2Clicked Method.
Is the code you posted above inside this OnButton2Clicked Method?
If yes, sender is the button you clicked on. So you tried to cast a button
to a TreeSelection. That's why you get a InvalidCastException.
--
View this message in context:
http://www.nabble.com/Treeview%2C-delete-the-selected-row-%28can%27t-get-it-done-%3A%28-%29-tp18144085p18150331.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list