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. .NET (Core and Framework)
  4. DataViews DataTables and DataGridViews and indexing

DataViews DataTables and DataGridViews and indexing

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasebeta-testingjsonhelpcode-review
2 Posts 2 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.
  • E Offline
    E Offline
    Ed Hill _5_
    wrote on last edited by
    #1

    Ok i have a DataTable containing a number of rows. I have two DataViews from this dataTable, one shows all the rows with a few hidden columns including a descriptionField, sorted by a date field. The second shows any rows that have a descriptionFeild that contains data only. The reason behind this is i'm producing a printable form that shows additional information if there is any on a seperate page to the rest of the data. Is there any easy way that i can get the index from one view to feedback into the dataset so it can be displayed by the second view. e.g.

    data set:
    date code time description
    21/11/08 DOC 00:12 document detailing house sale
    22/11/08 LTO 00:06
    22/11/08 LTI 00:06 responce to house sale document recieved

    data view 1:
    date code time
    21/11/08 DOC 00:12
    22/11/08 LTO 00:06
    22/11/08 LTI 00:06

    data view 2:
    description
    document detailing house sale
    responce to house sale document recieved

    what i need is data view 2 to either have a column with the index from its row in data view 1, or any other way of getting that index. Hope i have explained this well enough, googling for other people with the same problem showed lots of badly written and confusing examples of the same problem and no useful answers.

    B 1 Reply Last reply
    0
    • E Ed Hill _5_

      Ok i have a DataTable containing a number of rows. I have two DataViews from this dataTable, one shows all the rows with a few hidden columns including a descriptionField, sorted by a date field. The second shows any rows that have a descriptionFeild that contains data only. The reason behind this is i'm producing a printable form that shows additional information if there is any on a seperate page to the rest of the data. Is there any easy way that i can get the index from one view to feedback into the dataset so it can be displayed by the second view. e.g.

      data set:
      date code time description
      21/11/08 DOC 00:12 document detailing house sale
      22/11/08 LTO 00:06
      22/11/08 LTI 00:06 responce to house sale document recieved

      data view 1:
      date code time
      21/11/08 DOC 00:12
      22/11/08 LTO 00:06
      22/11/08 LTI 00:06

      data view 2:
      description
      document detailing house sale
      responce to house sale document recieved

      what i need is data view 2 to either have a column with the index from its row in data view 1, or any other way of getting that index. Hope i have explained this well enough, googling for other people with the same problem showed lots of badly written and confusing examples of the same problem and no useful answers.

      B Offline
      B Offline
      BillyGoatGruff
      wrote on last edited by
      #2

      It looks like the CurrencyManager and binding objects are what you're looking for: http://en.csharp-online.net/DataViews_and_Data_Binding%E2%80%94CurrencyManager_and_BindingContext[^] http://msdn.microsoft.com/en-us/library/system.windows.forms.currencymanager.aspx[^] These will ensure that if the two views are bound to the data through the same binding contect and currency manager, that a selection against one view will cause the same selections on the other.

      modified on Monday, December 8, 2008 12:05 PM

      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