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. Using query with where clause as datasource for combobox

Using query with where clause as datasource for combobox

Scheduled Pinned Locked Moved LINQ
databasequestion
3 Posts 2 Posters 3 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.
  • N Offline
    N Offline
    Nigel Mackay
    wrote on last edited by
    #1

    I can easily bind a simple query to a combobox. But if I have a where clause in the query it doesn't work: Complex DataBinding accepts as a data source either an IList or an IListSource. Is there a way to overcome this?

    A 1 Reply Last reply
    0
    • N Nigel Mackay

      I can easily bind a simple query to a combobox. But if I have a where clause in the query it doesn't work: Complex DataBinding accepts as a data source either an IList or an IListSource. Is there a way to overcome this?

      A Offline
      A Offline
      Anurag Gandhi
      wrote on last edited by
      #2

      Append your query with .ToList() ComboBox1.DataSource = MyData.Where(Condition).ToList(); Then, it should work.

      Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.

      N 1 Reply Last reply
      0
      • A Anurag Gandhi

        Append your query with .ToList() ComboBox1.DataSource = MyData.Where(Condition).ToList(); Then, it should work.

        Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.

        N Offline
        N Offline
        Nigel Mackay
        wrote on last edited by
        #3

        Of course :)

        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