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. WCF and WF
  4. Databinding - bind textbox and datagridview

Databinding - bind textbox and datagridview

Scheduled Pinned Locked Moved WCF and WF
csshelpquestion
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.
  • J Offline
    J Offline
    jogisarge
    wrote on last edited by
    #1

    Hi, i want to show in a textbox the value from a selected row in my datagridview.

    DataSet dsHersteller = new DataSet();
    BindingSource bsHersteller = new BindingSource();

    dsHersteller = herstellermanager.GetList(); // - delivers a dataset
    bsHersteller.DataSource = dsHersteller.Tables["producer"];
    bsHersteller.Sort = "producer_id";
    dgvHersteller.DataSource = bsHersteller.DataSource;

    tbxHerstellerNr.DataBindings.Add("Text", bsHersteller, "producer_id");

    Now, when i start the app, the value of the textbox is the first row in datagridview. If i select another row, nothing changes in my textbox. I thougt, i bound the textbox to the grid ?? Can anybody give me tips for my problem ? By jogi

    M 1 Reply Last reply
    0
    • J jogisarge

      Hi, i want to show in a textbox the value from a selected row in my datagridview.

      DataSet dsHersteller = new DataSet();
      BindingSource bsHersteller = new BindingSource();

      dsHersteller = herstellermanager.GetList(); // - delivers a dataset
      bsHersteller.DataSource = dsHersteller.Tables["producer"];
      bsHersteller.Sort = "producer_id";
      dgvHersteller.DataSource = bsHersteller.DataSource;

      tbxHerstellerNr.DataBindings.Add("Text", bsHersteller, "producer_id");

      Now, when i start the app, the value of the textbox is the first row in datagridview. If i select another row, nothing changes in my textbox. I thougt, i bound the textbox to the grid ?? Can anybody give me tips for my problem ? By jogi

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      jogisarge wrote:

      my datagridview

      Is this a Windows Forms question? If so, you're on the wrong board. Try the Windows Forms Board[^]. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      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