зеркало из https://github.com/mono/mail-archives.git
89 строки
3.4 KiB
HTML
89 строки
3.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] Treeview, delete the selected row (can't get it done :( )
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Treeview%2C%0A%20delete%20the%20selected%20row%20%28can%27t%20get%20it%20done%20%3A%28%20%29&In-Reply-To=18144085.post%40talk.nabble.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="008777.html">
|
|
<LINK REL="Next" HREF="008762.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] Treeview, delete the selected row (can't get it done :( )</H1>
|
|
<B>countcb</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Treeview%2C%0A%20delete%20the%20selected%20row%20%28can%27t%20get%20it%20done%20%3A%28%20%29&In-Reply-To=18144085.post%40talk.nabble.com"
|
|
TITLE="[Gtk-sharp-list] Treeview, delete the selected row (can't get it done :( )">count.cb at gmx.net
|
|
</A><BR>
|
|
<I>Fri Jun 27 04:18:15 EDT 2008</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="008777.html">[Gtk-sharp-list] ScrolledWindow and TextView
|
|
</A></li>
|
|
<LI>Next message: <A HREF="008762.html">[Gtk-sharp-list] Treeview, delete the selected row (can't get it done :( )
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#8761">[ date ]</a>
|
|
<a href="thread.html#8761">[ thread ]</a>
|
|
<a href="subject.html#8761">[ subject ]</a>
|
|
<a href="author.html#8761">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>
|
|
|
|
|
|
Werner666 wrote:
|
|
><i>
|
|
</I>><i>
|
|
</I>><i> [code]
|
|
</I>><i> TreeIter iter;
|
|
</I>><i> TreeModel model;
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> TreePath path = ((TreeSelection)sender).GetSelectedRows();
|
|
</I>><i> this.klantListStore.GetIter(out iter, path[0]);
|
|
</I>><i> Console.WriteLine(path[0]);
|
|
</I>><i>
|
|
</I>><i> klantListStore.Remove(ref iter);
|
|
</I>><i> [/code]
|
|
</I>><i>
|
|
</I>
|
|
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: <A HREF="http://www.nabble.com/Treeview%2C-delete-the-selected-row-%28can%27t-get-it-done-%3A%28-%29-tp18144085p18150331.html">http://www.nabble.com/Treeview%2C-delete-the-selected-row-%28can%27t-get-it-done-%3A%28-%29-tp18144085p18150331.html</A>
|
|
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="008777.html">[Gtk-sharp-list] ScrolledWindow and TextView
|
|
</A></li>
|
|
<LI>Next message: <A HREF="008762.html">[Gtk-sharp-list] Treeview, delete the selected row (can't get it done :( )
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#8761">[ date ]</a>
|
|
<a href="thread.html#8761">[ thread ]</a>
|
|
<a href="subject.html#8761">[ subject ]</a>
|
|
<a href="author.html#8761">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
|
|
mailing list</a><br>
|
|
</body></html>
|