.net - how to check if the listView is empty -


im creating windows form , have 2 problems

  1. i want enable button add item in listview otherwise disable if empty
  2. assuming have added item in listview. how can totalprice of item , put in label item added? thanks.

this code use compute total price of item in listview

    dim total integer = 0     each itemrow listviewitem in me.lvorder.items          total += convert.toint32(itemrow.subitems(2).text)      next 

sorry cant put image better understanding because need 10 reputation post image.

something simple should want:

btnxxx.enabled = (lvorder.items.count > 0) 

you need make sure doing in appropriate event(s). or when add or remove items


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -