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. How about DataCloumn.Expression

How about DataCloumn.Expression

Scheduled Pinned Locked Moved C#
question
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.
  • L Offline
    L Offline
    Libra
    wrote on last edited by
    #1

    Has a 'dataGrid1' and assign to 'dataTable1', 'dataTable1' have 3 columns: Col1,Col2,Col3, and then: Col1.ColumnName = "Col1"; Col2.ColumnName = "Col2"; Col3.ColumnName = "Col3"; Col1.DataType = System.Decimal; Col2.DataType = System.Int32; Col3.DataType = System.Decimal; Col3.Expression = "Col1 * Col2"; Col3.ReadOnly = true; // it's auto set Why at runtime, edit Col1, Col2 of the 'dataTable1' and then leave to other row, but Col3's value has not change yet, has not any be computed? Additional: I had try to new a 'dataRow1', and then give value to dataRow1[0], dataRow1[1], and at last 'Add()' this row in 'dataTable1'. At this time, run dataTable1.Refresh() and found that 'Col3' shown correct. Why at this time the Expression could be used. :confused::(( Why learn more, unaware more?

    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