none
Synchronizing through DataTable which contain same elements RRS feed

  • Question

  • Hello,

    i have this table:

    table_info:

    id (primary key)

    description

    fid_group (foreign key)

     

    fid_group points to a group. I present the information in the table table_info in my application by group. The user selects a group and sees all table_info items which have the specified fid_group parameter.

     

    I want to have two sides in my application. On the left I have a combobox where I can select the group, and there's also a listbox in which I will see the table_info elements with fid_group parameter of the group selected by the combobox. I want to have the same elements on the right side. For example I have group1 on the left side with some elements in the listbox, and i have group2 selected on the right side with different elements in the listbox.

     

    Now I want to drag & drop an element from the right side to the left side. I have an sql server. Easiest thing to do, would be to change the fid_group parameter of the element on the right side to the group_id selected in the combobox on the left side.

    BUT: I want two buttons on my application: "accept changes" and "abort". Is there a possibility to remove the item which is a datarow in a datatable, and the datatable is binded to the listbox. And to add it to the listbox on the left side. It is the same element, in sql syntax i only change the fid_group parameter to a different value. But I want to show the user what he has just done without updating the changes to the sql server yet.

     

     

    Friday, October 29, 2010 11:08 AM