vb.net - Filter on dataset clears all bound controls -
the following code works (rows filtered select expression), controls in datarepeater empty. when set .defaultview records return , controls have values.
private sub checkbox_filterapplied_checkedchanged(byval sender object, byval e system.eventargs) handles checkbox_filterapplied.checkedchanged if checkbox_filterapplied.checked ' richtextbox_notes.databindings.add("text", dstransactions.tables("transactionheader"), "note") datarepeater_transactions.datasource = dstransactions.tables("transactionheader").select("applied = 0") datarepeater_transactions.refresh() else datarepeater_transactions.datasource = dstransactions.tables("transactionheader").defaultview end if end sub
can't tell missing. refresh no help.
i think problem because of datasource of textbox , datasource of datarepeater.
i modified code slightly, please try it. works me.
dim dt new datatable dt.columns.add("col1") dt.columns.add("col2") dt.columns.add("col3") index = 1 10 dim dr datarow = dt.newrow() dr("col1") = index.tostring() dr("col2") = index.tostring() dr("col3") = index.tostring() dt.rows.add(dr) next dim dv dataview = new dataview(dt, "col1 >= 8", "", dataviewrowstate.currentrows) textbox1.databindings.add(new binding("text", dv, "col3")) datarepeater1.datasource = dv
hope helps :)
Comments
Post a Comment