How to clear the added rows from a datagridview binded using a BindingSource c# .net -
its windows form application. database ms access. using typed dataset. having datagridview, use insert data database. want clear rows added click on reset button on form. datagridview using bindingsource. binding source using typed datatable typed dataset
for following scenario
this.datagridviewpurdetails.datasource = this.purchasedetailbindingsource; // purchasedetailbindingsource // this.purchasedetailbindingsource.datamember = "purchasedetail"; this.purchasedetailbindingsource.datasource = this.tvdataset;
this solution worked
//clear rows datagridview
bindingsource dt = (bindingsource)datagridviewpurdetails.datasource; if (dt != null) ((tvdataset)dt.datasource).purchasedetail.clear();
Comments
Post a Comment