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. C#
  4. Virtual colums in a datagrid?

Virtual colums in a datagrid?

Scheduled Pinned Locked Moved C#
visual-studioxmltutorialquestion
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.
  • F Offline
    F Offline
    Franz Pentenrieder
    wrote on last edited by
    #1

    hi, im using a datagrid generated from a XML file using the VS XSD builder. now i want to add a "virtual" colum that add's some extra information, i only need this information on the runtime so i don't wanna add it to the XML file. i have read some examples with "BindingContext" and "Expression" but this examples are mostly DataGridBoolColumn and no TextColums. dose anybody knows a tuturial or have some example code?

    H 1 Reply Last reply
    0
    • F Franz Pentenrieder

      hi, im using a datagrid generated from a XML file using the VS XSD builder. now i want to add a "virtual" colum that add's some extra information, i only need this information on the runtime so i don't wanna add it to the XML file. i have read some examples with "BindingContext" and "Expression" but this examples are mostly DataGridBoolColumn and no TextColums. dose anybody knows a tuturial or have some example code?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      First, you should consider using DataGridTableStyle(s) to control exactly what the user sees (for instance, if you have a PK in your strongly-typed DataSet as a numeric type, users probably don't need to see that). This will allow you to add columns that aren't bound to the DataSet as well. You can use expressions in your DataSet and these are not limited to boolean expressions. For more information and examples, see the documentation for the DataColumn.Expression property at http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataDataColumnClassExpressionTopic.asp[^]. Why I mentioned DataGridTableStyle before is that you could also extend DataGridColumnStyle and make your own class if you need expressions that are supported by DataColumn.Expression. See the documentation for DataGridColumnStyle in the MSDN library at http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsDataGridColumnStyleClassTopic.asp[^].

      Microsoft MVP, Visual C# My Articles

      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