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. Bindingsource Question

Bindingsource Question

Scheduled Pinned Locked Moved C#
helpquestionwpfwcf
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.
  • D Offline
    D Offline
    Davey_guan
    wrote on last edited by
    #1

    Hi, I have a bindingsource binding to several text controls. I want to use the bindingsource.addnew() method to add a new line in the list, then move to the last record. My purpose is to set all these text controls empty to wait for input for the last record. But it failed. The bindingsource.position can not been set to the last record. :( Could you please help to solve this problem? thanks.

    Q 1 Reply Last reply
    0
    • D Davey_guan

      Hi, I have a bindingsource binding to several text controls. I want to use the bindingsource.addnew() method to add a new line in the list, then move to the last record. My purpose is to set all these text controls empty to wait for input for the last record. But it failed. The bindingsource.position can not been set to the last record. :( Could you please help to solve this problem? thanks.

      Q Offline
      Q Offline
      Qendro
      wrote on last edited by
      #2

      to do this I think you should do the following:

      DatRow dr = dsCustomerDataset.Customers.NewCustomerRow();
      dr[0] = "";
      dr[1] = "";
      dsCustomerDataset.Customers.AcceptChanges();

      then since you fill the binding source with your data set when you use the bindingSource.MoveLast() method it will fill your controls with empty data row which you'll add. hope this will help you!

      Qendro

      D 1 Reply Last reply
      0
      • Q Qendro

        to do this I think you should do the following:

        DatRow dr = dsCustomerDataset.Customers.NewCustomerRow();
        dr[0] = "";
        dr[1] = "";
        dsCustomerDataset.Customers.AcceptChanges();

        then since you fill the binding source with your data set when you use the bindingSource.MoveLast() method it will fill your controls with empty data row which you'll add. hope this will help you!

        Qendro

        D Offline
        D Offline
        Davey_guan
        wrote on last edited by
        #3

        Thanks Qendro. It helps.

        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