Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. DataBinding and Filtering

DataBinding and Filtering

Scheduled Pinned Locked Moved LINQ
linqcsharpwpfwcfalgorithms
7 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tristan Rhodes
    wrote on last edited by
    #1

    Hi Guys, I have a LINQ problem with binding to DataGrids. Filter does not work with IQueryable , so i'm going to have to do this with a DataTable, to handle sorting / filtering of data. However, somewhere along the road, IQueryable appears to have lost the ToDataTable() method. What are my available options now? Cheers Tris

    ------------------------------- Carrier Bags - 21st Century Tumbleweed.

    P 1 Reply Last reply
    0
    • T Tristan Rhodes

      Hi Guys, I have a LINQ problem with binding to DataGrids. Filter does not work with IQueryable , so i'm going to have to do this with a DataTable, to handle sorting / filtering of data. However, somewhere along the road, IQueryable appears to have lost the ToDataTable() method. What are my available options now? Cheers Tris

      ------------------------------- Carrier Bags - 21st Century Tumbleweed.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Wow. When I wrote this[^] blog post, I didn't realise it would be so useful for people. Enjoy your DataTabley goodness. ;)

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      T 1 Reply Last reply
      0
      • P Pete OHanlon

        Wow. When I wrote this[^] blog post, I didn't realise it would be so useful for people. Enjoy your DataTabley goodness. ;)

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        T Offline
        T Offline
        Tristan Rhodes
        wrote on last edited by
        #3

        Cheers. I had read it but didn't find what i want, at second glance, it appears to be right on the money. Why did they remove the two pieces of functionality that are required to easily get filtering to work? *Grumble Rant Growl*

        ------------------------------- Carrier Bags - 21st Century Tumbleweed.

        P 1 Reply Last reply
        0
        • T Tristan Rhodes

          Cheers. I had read it but didn't find what i want, at second glance, it appears to be right on the money. Why did they remove the two pieces of functionality that are required to easily get filtering to work? *Grumble Rant Growl*

          ------------------------------- Carrier Bags - 21st Century Tumbleweed.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Tristan Rhodes wrote:

          Why did they remove the two pieces of functionality that are required to easily get filtering to work?

          Well, Linq is supposed to be easy to filter by itself. You can get the data and then filter using Linq to Objects, or you can filter the data from the database.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          T 1 Reply Last reply
          0
          • P Pete OHanlon

            Tristan Rhodes wrote:

            Why did they remove the two pieces of functionality that are required to easily get filtering to work?

            Well, Linq is supposed to be easy to filter by itself. You can get the data and then filter using Linq to Objects, or you can filter the data from the database.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            T Offline
            T Offline
            Tristan Rhodes
            wrote on last edited by
            #5

            The condition generation is quite complicated and it is easier to apply it with a filter string generated by concatenation, than handle each individual condition in separate LINQ queries. Normally i would go with Linq Objects. Thanks for the article, i've got it working as a datagrid... good bye neat code, hello WTF. :( Tris

            ------------------------------- Carrier Bags - 21st Century Tumbleweed.

            P 1 Reply Last reply
            0
            • T Tristan Rhodes

              The condition generation is quite complicated and it is easier to apply it with a filter string generated by concatenation, than handle each individual condition in separate LINQ queries. Normally i would go with Linq Objects. Thanks for the article, i've got it working as a datagrid... good bye neat code, hello WTF. :( Tris

              ------------------------------- Carrier Bags - 21st Century Tumbleweed.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              Tristan Rhodes wrote:

              Thanks for the article, i've got it working as a datagrid... good bye neat code, hello WTF.

              OK - should I be insulted? ;)

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              T 1 Reply Last reply
              0
              • P Pete OHanlon

                Tristan Rhodes wrote:

                Thanks for the article, i've got it working as a datagrid... good bye neat code, hello WTF.

                OK - should I be insulted? ;)

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                T Offline
                T Offline
                Tristan Rhodes
                wrote on last edited by
                #7

                Heh, nope. I just hate DataTables. Had to re-write all my logic with (string)row["field"] == blahblah etc.

                ------------------------------- Carrier Bags - 21st Century Tumbleweed.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups