Results 1 to 2 of 2

Thread: Listview Key

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    treehouse
    Posts
    106

    Post

    I am trying to attach a key to my items I'm adding in the listview control and I get the error "Invalid key".
    The key I am adding is a primary number "13" which I use as a string. I thought the key accepted a string. I also tried to make it a integer but that did not work either. I think its something to do with the key being unique. I can't figure it out.

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Post

    Your problem is not a 'unique' identity problem, otherwise the list would tell you so with the error 'Key is not unique in collection'.

    The thing about Listviews and keys is that even though you may convert '13' into a string, it still recognises it as a number (we'll call it cleverness shall we?).

    If you want to use a numeric as the key, the best thing to do is append a single letter before the number you want to use...ie make the key 'K13' instead of just '13'.

    Hope this helps you!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width