[IronPython] How to find import in ipy

Michael Foord fuzzyman at voidspace.org.uk
Thu Mar 11 18:17:25 CET 2010


On 11/03/2010 17:11, Ken MacDonald wrote:
> Hi, I have an app with a popup containing a listbox. I want to 
> dynamically add a few items to the listbox and found code in a number 
> of places which does something like:
>
>             listbox.Items.Add(ListItem("Special", 11))
>             listbox.Items.Add(ListItem("Regular", 19))
>
> However, I can't find the proper import so that it finds ListItem. On 
> MSDN it shows as being in
>
> 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.

>
> 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


> Thanks,
> Ken
>
>
> _______________________________________________
> Users mailing list
> Users at 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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100311/061669fd/attachment.html>


More information about the Ironpython-users mailing list