Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 129719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:50:01+00:00 2026-05-11T05:50:01+00:00

I already bind a listview (grid) with hashtable, so how can I get items

  • 0

I already bind a listview (grid) with hashtable, so how can I get items from there? Before using hashtable I just did ListViewA.SelectedItems; and I was getting the source.

Ir fails when I use two foreach loops:

dlstTemplates is my ListView in WPF

foreach (var group in dlstTemplates.SelectedItems) {   foreach (var Template in group)   {    } } 

Error 2 foreach statement cannot operate on variables of type ‘object’ because ‘object’ does not contain a public definition for ‘GetEnumerator’ D:\cs_InformeMedico\app\Template.xaml.cs 85 21 Demo.View

I found this on debugger:

-       dlstPlantillas.SelectedItems    Count = 1   System.Collections.IList {System.Windows.Controls.SelectedItemCollection} -       [0] {System.Data.Linq.SqlClient.ObjectReaderCompiler.Group<string,Demo.View.Plantilla>} object {System.Data.Linq.SqlClient.ObjectReaderCompiler.Group<string,Demo.View.Plantilla>} -       Non-Public members       +       items   Count = 97  System.Collections.Generic.IEnumerable<Demo.View.Plantilla> {System.Collections.Generic.List<Demo.View.Plantilla>}         key '101010112000'  string         System.Linq.IGrouping<K,T>.Key  '101010112000'  string -       Results View    Expanding the Results View will enumerate the IEnumerable    +       [0] {Demo.View.Plantilla}   Demo.View.Plantilla +       [1] {Demo.View.Plantilla}   Demo.View.Plantilla +       [2] {Demo.View.Plantilla}   Demo.View.Plantilla +       [3] {Demo.View.Plantilla}   Demo.View.Plantilla +       [4] {Demo.View.Plantilla}   Demo.View.Plantilla +       [5] {Demo.View.Plantilla}   Demo.View.Plantilla +       [6] {Demo.View.Plantilla}   Demo.View.Plantilla +       [7] {Demo.View.Plantilla}   Demo.View.Plantilla +       [8] {Demo.View.Plantilla}   Demo.View.Plantilla +       [9] {Demo.View.Plantilla}   Demo.View.Plantilla +       [10]    {Demo.View.Plantilla}   Demo.View.Plantilla -       Raw View         -       [System.Windows.Controls.SelectedItemCollection]    Count = 1   System.Windows.Controls.SelectedItemCollection +       [0] {System.Data.Linq.SqlClient.ObjectReaderCompiler.Group<string,Demo.View.Plantilla>} object {System.Data.Linq.SqlClient.ObjectReaderCompiler.Group<string,Demo.View.Plantilla>} +       Raw View                 IsFixedSize false   bool         IsReadOnly  false   bool 

So when group is a

{System.Data.Linq.SqlClient.ObjectReaderCompiler.Group<string,Demo.View.Plantilla>} object type 

Sorry Plantilla = Template, I traduce it for more understand

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:50:02+00:00Added an answer on May 11, 2026 at 5:50 am

    You don’t seem to be working with a collection in the second loop.
    Maybe you wanted

    foreach(var group in dlstTemplates.SelectedItems) {     foreach(var Template in groupCast.Templates)     {         //do stuff...     } } 

    or somesuch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I'm just beinning basic data driven ASP.NET webforms design. I have the first part
This is not a question, cause I already answerd it. But it may be
when I use AllowPaging=True property in gridview and upload my webSite ,when I click
I am trying to bind a ComboxBox to a foreign key table. I know

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.