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. Visual Basic
  4. DLINQ Combo Box in Datagridview

DLINQ Combo Box in Datagridview

Scheduled Pinned Locked Moved Visual Basic
csharpdatabaselinqquestion
1 Posts 1 Posters 0 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.
  • C Offline
    C Offline
    Chrispie123
    wrote on last edited by
    #1

    Good Morning I have a query related to DLINQ. I have a datagridview with a combo box in the one field. The user may select categories from the drop down box. Only one category can exist (no duplicates). What I want to do is using LINQ to get a new dataset containing all the records that is not selected (by the datagridview) and the value of the current selected one and gives that as a datasource for the combo box. This way the user doesn’t have multiple options that they shouldn’t select anyway but only the ones they can select. I have problems defining a query to get the data. Has anyone tried doing this before? I have played around and this is what I have currently but it doesn't include the current row aswell. (I am new to LINQ and don't understand the full meaning of the queries - any one can translate it in normal word will great :-D - The code snippet below is by looking at examples)

    Dim query = From t1 In dataset1.tblLookup.AsEnumerable() _
    Group Join r In dataset2.tblMainDisplayDGV.AsEnumerable() _
    On r.Field(Of String)("CommonField") Equals t1.Field(Of String)("CommonField") _
    Into x = Group _
    From r2 In x.DefaultIfEmpty() _
    Where r2 Is Nothing _
    Select t1

    Regards, Christiaan

    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