Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: exe giving exception while running on xp [modified] Pin
situ2131-Mar-11 23:34
situ2131-Mar-11 23:34 
GeneralRe: exe giving exception while running on xp Pin
Eddy Vluggen1-Apr-11 0:04
professionalEddy Vluggen1-Apr-11 0:04 
AnswerChange your Username!!!! Pin
Keith Barrow1-Apr-11 6:44
professionalKeith Barrow1-Apr-11 6:44 
AnswerRe: exe giving exception while running on xp Pin
RaviRanjanKr6-Apr-11 19:15
professionalRaviRanjanKr6-Apr-11 19:15 
AnswerRe: exe giving exception while running on xp Pin
Ganesh Kumar Kaki13-Apr-11 2:09
Ganesh Kumar Kaki13-Apr-11 2:09 
QuestionLINQ on un-typed IList collections? Pin
SledgeHammer0131-Mar-11 10:50
SledgeHammer0131-Mar-11 10:50 
AnswerRe: LINQ on un-typed IList collections? Pin
Not Active31-Mar-11 11:52
mentorNot Active31-Mar-11 11:52 
GeneralRe: LINQ on un-typed IList collections? Pin
SledgeHammer0131-Mar-11 12:05
SledgeHammer0131-Mar-11 12:05 
Mark Nischalke wrote:

It is not untyped, ListView.SelectedItems returns a collection of
ListViewItem(s).

----


You are mistaken sir Smile | :) . ListView.SelectedItems most certainly does NOT return ListViewItems (unless you are binding to stock ListViewItems). It returns whatever type you are binding with.

If my ItemsSource is a ObservableCollection<Widget>, SelectedItems returns a collection of Widgets, not ListViewItems.

The definition of ListView.SelectedItems is:

[BindableAttribute(true)]
public IList SelectedItems { get; }

As you can see, un-typed Big Grin | :-D .

Also, when I look in the debugger, SelectedItems is actually a:

- SelectedItems Count = 1 System.Collections.IList {System.Windows.Controls.SelectedItemCollection}

System.Windows.Controls.SelectedItemCollection is a private class.

Naturally, this fails:

IList<ListViewItem> selectedItems = SelectedItems as IList<ListViewItem>;

because it ain't that type Smile | :) . Unless you meant something else.

But regardless, as I look in the debugger, <whatever you want to say SelectedItems returned>[0] is NOT a ListViewItem, its a Widget.

My issue is that I don't know what type it is, so I need to do a RemoveAllExceptThis as an object.
GeneralRe: LINQ on un-typed IList collections? Pin
Not Active31-Mar-11 12:12
mentorNot Active31-Mar-11 12:12 
AnswerRe: LINQ on un-typed IList collections? Pin
Keith Barrow31-Mar-11 12:19
professionalKeith Barrow31-Mar-11 12:19 
GeneralRe: LINQ on un-typed IList collections? Pin
SledgeHammer0131-Mar-11 12:53
SledgeHammer0131-Mar-11 12:53 
GeneralRe: LINQ on un-typed IList collections? Pin
DaveyM6931-Mar-11 23:51
professionalDaveyM6931-Mar-11 23:51 
GeneralRe: LINQ on un-typed IList collections? Pin
SledgeHammer011-Apr-11 4:45
SledgeHammer011-Apr-11 4:45 
GeneralRe: LINQ on un-typed IList collections? Pin
DaveyM691-Apr-11 10:34
professionalDaveyM691-Apr-11 10:34 
GeneralRe: LINQ on un-typed IList collections? Pin
SledgeHammer011-Apr-11 11:23
SledgeHammer011-Apr-11 11:23 
Questionhelp in vcd cutter Pin
gufranciit31-Mar-11 4:56
gufranciit31-Mar-11 4:56 
AnswerRe: help in vcd cutter PinPopular
Keith Barrow31-Mar-11 5:12
professionalKeith Barrow31-Mar-11 5:12 
AnswerRe: help in vcd cutter Pin
RaviRanjanKr6-Apr-11 19:19
professionalRaviRanjanKr6-Apr-11 19:19 
Questionhow to check how many messages are in sim memory Pin
aeman31-Mar-11 2:24
aeman31-Mar-11 2:24 
QuestionResponse large size data Pin
anishkannan31-Mar-11 1:14
anishkannan31-Mar-11 1:14 
AnswerRe: Response large size data Pin
#realJSOP31-Mar-11 1:38
professional#realJSOP31-Mar-11 1:38 
AnswerRepeat Pin
Not Active31-Mar-11 2:33
mentorNot Active31-Mar-11 2:33 
QuestionAppdomain [modified] Pin
abcurl31-Mar-11 0:35
abcurl31-Mar-11 0:35 
AnswerRe: Appdomain Pin
Rob Philpott31-Mar-11 1:31
Rob Philpott31-Mar-11 1:31 
QuestionProtecting from plugin crashes Pin
Benny_Lava30-Mar-11 22:37
Benny_Lava30-Mar-11 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.