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

  • Home
  • SEARCH
  • 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 8944059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:56:32+00:00 2026-06-15T11:56:32+00:00

I am using ArcGIS. I am trying to sort the data manually after its

  • 0

I am using ArcGIS. I am trying to sort the data manually after its found. I created a property class and loop through a Tlist to scrub unwanted data. However right before it binds to the data grid, I receive a cast error. I assume something is coming back null. Am I missing something??

 Public Class temp
    Public Sub New()
    End Sub
    Public Property DisplayFieldName As String
    Public Property Feature As ESRI.ArcGIS.Client.Graphic
    Public Property FoundFieldName As String
    Public Property LayerId As Integer
    Public Property LayerName As String
    Public Property Value As Object
End Class

Public Class templst
    Public Sub New()
        Dim findresult = New List(Of temp)
    End Sub
    Private _findresult = findresult
    Public Property findresult() As List(Of temp)
        Get
            Return _findresult
        End Get
        Set(ByVal value As List(Of temp))
            _findresult = value
        End Set
    End Property
End Class

Private Sub FindTask_Complete(ByVal sender As Object, ByVal args As FindEventArgs) 
        Dim newargs As New templst() 'puts Tlist (temp) into property
        Dim templistNUMONLY As New List(Of temp) 'Tlist of temp
            For Each r In args.FindResults 'class in compiled dll.
                 If Regex.Match(r.Value.ToString, "[0-9]").Success Then
                templistNUMONLY.Add(New temp() With {.LayerId = r.LayerId,
                                              .LayerName = r.LayerName,
                                              .Value = r.Value,
                                              .FoundFieldName = r.FoundFieldName,
                                              .DisplayFieldName = r.DisplayFieldName,
                                              .Feature = r.Feature})
                 End If
            Next

        newargs.findresult = templistNUMONLY

            Dim sortableView As New PagedCollectionView(newargs.findresult)
            FindDetailsDataGrid.ItemsSource = sortableView 'populate lists here
        End Sub

BIND TO GRID HERE: (Error here)

Private Sub FindDetails_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
        ' Highlight the graphic feature associated with the selected row
          Dim dataGrid As DataGrid = TryCast(sender, DataGrid)

          Dim selectedIndex As Integer = dataGrid.SelectedIndex
           If selectedIndex > -1 Then
          '''''''''''''''''CAST ERROR HERE:
           Dim findResult As FindResult = CType(FindDetailsDataGrid.SelectedItem, FindResult)
  • 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. Editorial Team
    Editorial Team
    2026-06-15T11:56:33+00:00Added an answer on June 15, 2026 at 11:56 am

    You populate FindDetailsDataGrid with objects of type temp, but you try to cast it to type FindResult instead. You should do:

    Dim selectedTemp As temp = CType(FindDetailsDataGrid.SelectedItem, temp)
    '*Create find result from selected temp object here*
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an arcGIS newbie and I'm trying to visualize a map I've created with
I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with
I'm trying to make ESRI's ArcGIS combobox editable. I'm using eclipse and writing in
I am using the localStorage in this demo here, http://help.arcgis.com/en/webapi/javascript/arcgis/demos/exp/exp_webstorage.html Basically it is a
Using the following as an example (with $db being a previously created database connection
Using NLTK and WordNet , how do I convert simple tense verb into its
I am using ArcGIS focal statistics tool to add spatial autocorrelation to a random
Using the ArcGIS Server Flex API, is there a way to convert mouse coordinates
i am using visual studio 2010 and arcgis server 10 to develop Server Object
We are currently designing a GIS intranet application using GWT and ESRI ArcGIS. We

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.