On 11/03/2010 17:33, Ken MacDonald wrote:
Thanks Michael,
We're using .NET, so this should be OK, I guess?

If you're using IronPython that you are definitely using .NET. Do you mean you are using ASP.NET?

All of the other controls (StackPanel, Grid...) are being imported from System.Windows.Controls, so I thought ListItem ought to have been somewhere in there.


    from System.Web.UI.WebControls import ListItem

    That's for ASP - is that what you are using?


    but I get "can't import UI"

    You will need to add a reference to its containing assembly before
    you can import it.


What is the 'containing assembly'? Should I do something like....

If you go to the MSDN page you were using as a reference previously it will tell you what *assembly* the WebControls namespace is contained in (System.Web perhaps).

You will need to add a reference to this assembly before you can import from it. This will look *something* like:

    import clr
    clr.AddReference('System.Web')

All the best,

Michael


from System.Web import UI

(guess, not, same error!)



    So, anyone know how to do this?

    Also, I'm concerned that next time (if I ever get it working
    first time) I come to this popup, it will contain the items I had
    added previously; how does one go about clearing the whole listbox?
    listbox.Items.Clear()

    HTH,

    Michael



_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your 
employer, to release me from all obligations and waivers arising from any and all 
NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, 
confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS 
AGREEMENTS") that I have entered into with your employer, its partners, licensors, 
agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. 
You further represent that you have the authority to release me from any BOGUS AGREEMENTS 
on behalf of your employer.


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to