7

How to clear all rows from a Repeater?

I've tried:

RptSeatOrLap.DataSource=Nothing

But it's not working.

4 Answers 4

12

You need to call DataBind() in order to see the effect of new data source being assigned.

RptSeatOrLap.DataSource=dtEmptyDataTable;
RptSeatOrLap.DataBind();
0
5
rpt.DataSource = null;
rpt.DataBind();
0

'use dispose:

rpt.Dispose 
rpt.DataBind()
0
rpt.Items.Clear()
rpt.DataBind()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.