<div dir="ltr">Actually i'm just trying to use a .net System.Object List with this one - <a href="http://objectlistview.sourceforge.net/cs/index.html">http://objectlistview.sourceforge.net/cs/index.html</a>. I like the way the grid is displayed on that objectlistview so i'm trying to experiment and dispay, but what i get is just an empty row. <div>
<div><span class="" style="white-space:pre"><br></span></div><div style><span class="" style="white-space:pre">Here is the snippet of my code.</span></div><div><span class="" style="white-space:pre"><br></span></div><div>
<span class="" style="white-space:pre"> </span>def LoadRecord(self,sender,e):</div><div><span class="" style="white-space:pre"> </span>listing = List[person]()</div><div><span class="" style="white-space:pre"> </span>listing.Add(person('jojo','maquiling'))</div>
<div><span class="" style="white-space:pre"> </span>listing.Add(person('gary','granada'))</div><div><span class="" style="white-space:pre"> </span>self._objectListView1.SetObjects(listing)</div></div><div>
<br></div><div><br></div><div style>A datagrid is good,I have used it, but then i just want to figure out also if its possible for me to use this ObjectListView control on my application.</div><div style><br></div><div style>
Thanks and best regards.</div><div style><br></div><div style>Jojo Maquiling</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 24, 2013 at 12:00 PM, <a href="mailto:brad@fie.us">brad@fie.us</a> <span dir="ltr"><<a href="mailto:brad@fie.us" target="_blank">brad@fie.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>What exactly are you trying to do? It looks like you are trying to create a class in python that inherits from .net's System.Object, rather than python's object. But then you treat it as a dynamic object, which it really isn't. And then you try and treat it as a statically typed object, which it doesn't seem t be either really, now that you've treated it as dynamic in python. What is the intent? Do you mean to create a dynamic object that both .net and python treat as a dynamically typed object?</div>
<br><div><div><div class="h5"><div>On May 23, 2013, at 9:40 PM, Jojo Maquiling <<a href="mailto:jojo.maquiling@kadjo.org" target="_blank">jojo.maquiling@kadjo.org</a>> wrote:</div><br></div></div><blockquote type="cite">
<div><div class="h5"><div dir="ltr"><div>Here is the issue that i need to address:</div><div><br></div><div><b><br></b></div><div><b># My declaration is just fine here </b></div><div><br></div><div>>>> class person(System.Object):</div>
<div><span style="white-space:pre-wrap"> </span>def __init__(self,fname,lname):</div><div><span style="white-space:pre-wrap"> </span>self.Firstname = fname</div><div><span style="white-space:pre-wrap"> </span>self.Lastname = lname</div>
<div><br></div><div><span style="white-space:pre-wrap"><b># adding a value also goes fine. </b> </span></div><div>>>> j = person('jojo','maquiling')</div><div>>>> j<br></div><div>
<__main__.person object at 0x029E7C88></div><div>>>> j.Firstname</div><div>'jojo'</div><div>>>> j.Lastname</div><div>'maquiling'</div><div><br></div><div><b>#but then when i use listing and print it, here comes the problem</b></div>
<div><b><br></b></div><div>>>> listing = List[person]()</div><div>>>> listing</div><div><System.Collections.Generic.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] object at 0x029E7C60></div>
<div>>>> listing.Add(person('pepe','smith'))</div><div>>>> for l in listing:</div><div><span style="white-space:pre-wrap"> </span>print l.Firstname</div><div><br></div><div><b><i><font color="#ff0000">Traceback (most recent call last):</font></i></b></div>
<div><b><i><font color="#ff0000"> File "<pyshell#78>", line 2, in <module></font></i></b></div><div><b><i><font color="#ff0000"> print l.Firstname</font></i></b></div><div><b><i><font color="#ff0000">AttributeError: 'Object' object has no attribute 'Firstname'</font></i></b></div>
<div><b><i><br></i></b></div><div><br></div><div>Can any body help me on how to do this properly?</div><div>Thanks and best regards,</div><div><br></div><div>Jojo Maquiling</div><div><b><i><br>
</i></b></div><div><b><i><br></i></b></div></div></div></div>
_________________________________________________<br><a href="http://Python.NET" target="_blank">Python.NET</a> mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">http://mail.python.org/mailman/listinfo/pythondotnet</a></blockquote>
</div><br></div></blockquote></div><br></div>