troubleshooting Question

VB Anonymous Type problem

Avatar of Philippe Renaud
Philippe RenaudFlag for Canada asked on
.NET ProgrammingC#Visual Basic.NET
3 Comments1 Solution412 ViewsLast Modified:
Hello EE,

i have a CheckedListBox dataSource from :

            Dim q = _
                    (From m In dict
                     Select ID = m.Key _
                          , EDE_Description = m.Value).ToList()

                lstList.DataSource = q

now  I want to do:  for each item in that checkedListBox.. if it is unchecked then do see if you can Checked it :

( CT  here is the checkedListBox Control ) ...

                For x As Integer = 0 To ct.Items.Count - 1
                    Dim chkstate As CheckState
                    chkstate = ct.GetItemCheckState(x)
                    If (chkstate = CheckState.Unchecked) Then
                        Dim rDict As RouteValueDictionary = ct.Items(x)   ---> Error is here
                        MessageBox.Show(rDict.Item(0)) --> error here also
                    End If
                Next

the datasource is working fine, but it seems its an VB AnonymousType such as { Key = 1, Value = "Test" }

How can I retrieve the Key  OR the Value ?  
I tried RouteValueDictionnary didnt work ... ?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros