By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,550 Members | 918 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,550 IT Pros & Developers. It's quick & easy.

Visual Studio 2003, Watch Window, ListView, SubItems

P: n/a
Greetings.

I have a ListView control loaded with several items and I'd like to
explore the collection via the Watch Window in Visual Studio .NET 2003.
My textbook was written for the previous version of Visual Studio and
it looks like you're able to explore the collection via that Watch
Window but I'm unable to do that in 2003. Am I missing something or has
this feature gone away?

I've found a few posts from people complaining about this "feature" but
no follow up. Can anyone shed any light on this?

By the way, when I expand the SubItems item, next to Item it says
<cannot view indexed property>.

Thanks,
Jeff

Mar 27 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
>> By the way, when I expand the SubItems item, next to Item it says
<cannot view indexed property>.


So it sounds like you ARE watching the ListView, but can't get to the
sub items, correct?

When you get this error, you can use the Count or Length properties to
see how many items are in the collection, and then reference them
directly.
Ie. MyListView.Items(0).SubItems(1)
You can type this directly into the Watch window.
Also you could always write out the object information to a log file or
console.
This works in VS2003

In the case of Datarows, you can just use the ItemArray property
instead of the default indexer to view all the items at once.

Worse case you could always inherit from whatever object you are having
trouble viewing and expose your own ItemArray property.

Hope this helps,
SN

Mar 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.