winforms - checkbox & datagridview not reading new column, write works fine (c#) -


i have datagridview bound data source (a dataset based on sql view). made of textboxes few checkboxes. on form contains dgv there controls editing each of column. on form_load view gets populated contents of sql view. done using fill command of table adapter, , works perfectly.

now add new column dgv modifying data source include new bit value. add new column using tasks editor datagrid view. add corresponding checkbox form set value of column bound binding source used dgv. if check new checkbox , hit "save", database updated new value, change not reflected in dgv or bound checkbox control. sequence follows:

//execute update statement: command.executenonquery();  //refill table: vwtileadmintableadapter.fill(tiledataset.vwtileadmin);  //reset binding source - maybe problem here? vwtileadminbindingsource.datasource = typeof(tiledataset.vwtileadmindatatable); vwtileadminbindingsource.datasource = this.tiledataset.vwtileadmin; datagridview1.datasource = null; datagridview1.datasource = this.vwtileadminbindingsource; vwtileadminbindingsource.resetbindings(false); // false data change, true schema change vwtileadminbindingsource.endedit(); 

this has seemed work in past when have modified dgv in way. seems binding working in 1 direction (write), can see changes database in sql management studio after each save, yet new checkbox shows value of zero. tried deleting dgv , re-adding along of events.

i found endedit command morning makes no difference. tried setting argument of resetbindings true , made no difference.

i thought 10 minute change , i'm out of ideas. in advance insight.

make sure new column on table in dataset, make sure column in commandtext of fill query.

also, line

vwtileadmintableadapter.fill(tiledataset.vwtileadmin); 

should sufficient refresh data.


Comments