Background Update the DataTable line content

xiaoxiao2021-03-06  15

These days have been looking for binding, after the binding, the DataTable line is made, and it is found, but it has to achieve such functions.

I am binding the DataTable to listbox, modify the listbox value by modifying DataTable.

ListBox1.beginupdate (); // stop the listbox from drawing while items areaded.

DataTable DT;

INT indexnum = listbox1.selectedindex;

DT = (DATATABLE) ListBox1.datasource;

Datarow Custrow = DT.ROWS [IndexNum];

Custrow.beginedit ();

Custrow [0] = indexnum;

Custrow [1] = "instator";

Custrow.endedit ();

Dt.acceptchanges ();

Listbox1.endupdate (); // end the update process and force a repaint of the listbox.

Listbox1.update ();

ListBox1.beginupdate (); // stop the listbox from drawing while items areaded.

DataTable DT;

INT indexnum = listbox1.selectedindex;

DT = (DATATABLE) ListBox1.datasource;

Datarow Custrow = DT.ROWS [IndexNum];

Custrow.beginedit ();

Custrow [0] = indexnum;

Custrow [1] = "instator";

Custrow.endedit ();

Dt.acceptchanges ();

Listbox1.endupdate (); // end the update process and force a repaint of the listbox.

Listbox1.update ();

转载请注明原文地址:https://www.9cbs.com/read-45806.html

New Post(0)