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. DataBinding value to expression that looks at multiple object values

DataBinding value to expression that looks at multiple object values

Scheduled Pinned Locked Moved C#
questiondiscussion
3 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.
  • J Offline
    J Offline
    jchalfant
    wrote on last edited by
    #1

    So I'm trying to find a way to bind CheckBox::Enabled to an expression that looks at a unary operation of a column in two rows of a DataTable that I'm pulling using an XSD generated by VS2005. I know I can do this through a validation event, however I'd like to do it through the designer if at all possible. Pretty much I'd like to bind checkboxobject.Enabled to: (someDataRow["column"]==value || nextDataRow["column"]==value) Any thoughts on how I might be able to do this?

    K J 2 Replies Last reply
    0
    • J jchalfant

      So I'm trying to find a way to bind CheckBox::Enabled to an expression that looks at a unary operation of a column in two rows of a DataTable that I'm pulling using an XSD generated by VS2005. I know I can do this through a validation event, however I'd like to do it through the designer if at all possible. Pretty much I'd like to bind checkboxobject.Enabled to: (someDataRow["column"]==value || nextDataRow["column"]==value) Any thoughts on how I might be able to do this?

      K Offline
      K Offline
      KaptinKrunch
      wrote on last edited by
      #2

      Without knowing what the conditions are to either turn on or off the checkbox. If its where value equals true.... if(someDataRow['column'] == true || nextDataRow['column'] == true) checkbox.Enabled = true; else checkbox.Enabled = false; or you could use... checkbox.Enabled = someDataRow['column'] == value ? true : false; if(checkbox.Enabled == false) checkbox.Enabled = nextDataRow['column'] == value ? true : false; There are many ways to accomplish this task, good luck.

      Just because we can; does not mean we should.

      1 Reply Last reply
      0
      • J jchalfant

        So I'm trying to find a way to bind CheckBox::Enabled to an expression that looks at a unary operation of a column in two rows of a DataTable that I'm pulling using an XSD generated by VS2005. I know I can do this through a validation event, however I'd like to do it through the designer if at all possible. Pretty much I'd like to bind checkboxobject.Enabled to: (someDataRow["column"]==value || nextDataRow["column"]==value) Any thoughts on how I might be able to do this?

        J Offline
        J Offline
        jchalfant
        wrote on last edited by
        #3

        BAH!! I've already done this. I can just set a filter in a binding source and bind Enabled to any column containing a positive integer value in that source. Thanks for your input KK. If I wind up putting code in the validation event, that's probably what I'll do.

        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