Results 1 to 2 of 2

Thread: Help with Saving data in a combobox in a datarepeater

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2011
    Posts
    46

    Help with Saving data in a combobox in a datarepeater

    I Have a Datarepeater on my Form that has a Label and a Combobox.

    The Combobox has two items IN & OUT. I want the data to update when the user changes the Current value.

    There is a save button on the toolbar (auto generated toolstrip) but I dont want the user to have to click that everytime.
    that button causes the following command.

    Me.TableAdapterManager.UpdateAll(Me.NewDBADataSet)

    I Tried,
    SelectedIndexChanged & SelectedValueChanged

    the Selected index change seems to only work if the user moves to the next item in the datarepeater and changed that combobox.

    Help

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Help with Saving data in a combobox in a datarepeater

    Like the DataGridView, Repeater edits are not completed until the cell/control registers the leave event for which the user must either move to a new cell or leave the control altogether. That's why the IndexChanged event won't fire until after the new cbox is selected. As I said in another thread on more or less the same lines it's really not wise to have updates dependent on editing events for the simple reason that there is no way to tell when an edit is actually completed, even with as simple a case as a binary choice. Remember that it's not necessary to update on every change with a bound control. All the changes will be retained by the datatable until such time as the user wants to commit them to the database.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width