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. C# WinForms DataBinding?

C# WinForms DataBinding?

Scheduled Pinned Locked Moved C#
csharpwinformshelptutorialquestion
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.
  • W Offline
    W Offline
    wbjohnson
    wrote on last edited by
    #1

    Hi all, Im having a problem with what should be really easy!! I have BindingList of type MyObject. MyObject has 2 properties, Name and Description... I can bind the BindingList to a listview no problem using DisplayMember and DataSource. But what i really want is so when I select an item in the listview, i want 2 textboxes to bind to the current item and let me change the value of these 2 items, but as i edit the Name textbox I want it to change the listview?? Is this 2way databinding? Any ideas on how to acheive this? Im assuming its possible!

    N 1 Reply Last reply
    0
    • W wbjohnson

      Hi all, Im having a problem with what should be really easy!! I have BindingList of type MyObject. MyObject has 2 properties, Name and Description... I can bind the BindingList to a listview no problem using DisplayMember and DataSource. But what i really want is so when I select an item in the listview, i want 2 textboxes to bind to the current item and let me change the value of these 2 items, but as i edit the Name textbox I want it to change the listview?? Is this 2way databinding? Any ideas on how to acheive this? Im assuming its possible!

      N Offline
      N Offline
      nelsonpaixao
      wrote on last edited by
      #2

      Hi johnson, what kind of datasource you have? are you filling your listviews, textboxes and other stuff with data from a dtabase right? I ussualy use comboxes and textboxes, listview i dont use but i think they work the same. So, you fill you listview with data, right? and you do some editing in the textboxes, right? and you want that changes o appear in the listview i suppose. Listen johnson, you dont really edit the listview! you edit the database (have to create one if you dont have one)! 1) Fill your listview with data from the database, and bind your texboxes to the listview. 2) When you what to edit listview from the textboxes, you will have to trigger a sql store_procedure (using sql server) that edits a record, after trigger another procedure the refreshs data so new record(or chanded record) appear in your listview. Again, you edit/delete/add records in a database not in the listview GoodLuck :-O

      nelsonpaixao@yahoo.com.br trying to help & get help

      W 1 Reply Last reply
      0
      • N nelsonpaixao

        Hi johnson, what kind of datasource you have? are you filling your listviews, textboxes and other stuff with data from a dtabase right? I ussualy use comboxes and textboxes, listview i dont use but i think they work the same. So, you fill you listview with data, right? and you do some editing in the textboxes, right? and you want that changes o appear in the listview i suppose. Listen johnson, you dont really edit the listview! you edit the database (have to create one if you dont have one)! 1) Fill your listview with data from the database, and bind your texboxes to the listview. 2) When you what to edit listview from the textboxes, you will have to trigger a sql store_procedure (using sql server) that edits a record, after trigger another procedure the refreshs data so new record(or chanded record) appear in your listview. Again, you edit/delete/add records in a database not in the listview GoodLuck :-O

        nelsonpaixao@yahoo.com.br trying to help & get help

        W Offline
        W Offline
        wbjohnson
        wrote on last edited by
        #3

        Hi there! thanks for the heads up! ill do a bit of digging in the week and hopefully get this problem sorted! once again - thanks for your help!

        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