mail-archives/gtk-sharp-list/2009-January/009337.html

143 строки
5.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Query getting values from treeview
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Query%20getting%20values%20from%20treeview&In-Reply-To=981F46194F2B4AE7BEADE6A400C551CC%40D134151">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="009334.html">
<LINK REL="Next" HREF="009338.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Query getting values from treeview</H1>
<B>Iggy</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Query%20getting%20values%20from%20treeview&In-Reply-To=981F46194F2B4AE7BEADE6A400C551CC%40D134151"
TITLE="[Gtk-sharp-list] Query getting values from treeview">iggy.ma at gmail.com
</A><BR>
<I>Wed Jan 7 13:12:44 EST 2009</I>
<P><UL>
<LI>Previous message: <A HREF="009334.html">[Gtk-sharp-list] Query getting values from treeview
</A></li>
<LI>Next message: <A HREF="009338.html">[Gtk-sharp-list] Query getting values from treeview
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#9337">[ date ]</a>
<a href="thread.html#9337">[ thread ]</a>
<a href="subject.html#9337">[ subject ]</a>
<a href="author.html#9337">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Look up the TreeView in the mono documentation. There is a method
called Foreach that iterates the store
On Wed, Jan 7, 2009 at 5:36 AM, libin &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">libin.mohanan at wipro.com</A>&gt; wrote:
&gt;<i>
</I>&gt;<i> Hi All,
</I>&gt;<i>
</I>&gt;<i> i have a GTK# treeview which have two columns Name and value.
</I>&gt;<i> I am populating the values of this in a liststore and i am adding this to
</I>&gt;<i> the treeview.
</I>&gt;<i> Now for testing purpose i want to itetrate through all the values inside
</I>&gt;<i> this two columns.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> This is how the code look like,
</I>&gt;<i> ------------------------------------------------------------------------------------------------------------------------------------
</I>&gt;<i> inside a foreach loop
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> {
</I>&gt;<i>
</I>&gt;<i> strName = childNode.Attributes.GetNamedItem(&quot;name&quot;).Value;
</I>&gt;<i>
</I>&gt;<i> strValue = childNode.Attributes.GetNamedItem(&quot;value&quot;).Value;
</I>&gt;<i>
</I>&gt;<i> listStore.AppendValues(strValue,strName);
</I>&gt;<i>
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> then adding this liststore to treeview
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> ListView= new TreeView(listStore);
</I>&gt;<i>
</I>&gt;<i> ListView.AppendColumn(
</I>&gt;<i>
</I>&gt;<i> &quot;Name&quot;, new CellRendererText(), &quot;text&quot;, 0);
</I>&gt;<i>
</I>&gt;<i> ListView.AppendColumn(
</I>&gt;<i>
</I>&gt;<i> &quot;Value&quot;, new CellRendererText(), &quot;text&quot;, 1);
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> ListWindow.Add(ListView);
</I>&gt;<i>
</I>&gt;<i> --------------------------------------------------------------------------------------------------------------------------------------
</I>&gt;<i>
</I>&gt;<i> Anyboby pls provide me the syntax for iterating through each values in each
</I>&gt;<i> columns.
</I>&gt;<i>
</I>&gt;<i> Thanks a lot!!!
</I>&gt;<i>
</I>&gt;<i> Libin
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> Please do not print this email unless it is absolutely necessary.
</I>&gt;<i>
</I>&gt;<i> The information contained in this electronic message and any attachments to
</I>&gt;<i> this message are intended for the exclusive use of the addressee(s) and may
</I>&gt;<i> contain proprietary, confidential or privileged information. If you are not
</I>&gt;<i> the intended recipient, you should not disseminate, distribute or copy this
</I>&gt;<i> e-mail. Please notify the sender immediately and destroy all copies of this
</I>&gt;<i> message and any attachments.
</I>&gt;<i>
</I>&gt;<i> WARNING: Computer viruses can be transmitted via email. The recipient should
</I>&gt;<i> check this email and any attachments for the presence of viruses. The
</I>&gt;<i> company accepts no liability for any damage caused by any virus transmitted
</I>&gt;<i> by this email.
</I>&gt;<i>
</I>&gt;<i> www.wipro.com
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
</I>&gt;<i>
</I>&gt;<i>
</I></PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="009334.html">[Gtk-sharp-list] Query getting values from treeview
</A></li>
<LI>Next message: <A HREF="009338.html">[Gtk-sharp-list] Query getting values from treeview
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#9337">[ date ]</a>
<a href="thread.html#9337">[ thread ]</a>
<a href="subject.html#9337">[ subject ]</a>
<a href="author.html#9337">[ 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>