Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
650
Databinding to List<T> showing incorrect items
posted

I am databinding a Combo to a List<T> by setting the DataSource property. I have 2 items and I can see them.

On a click of a button I set the DataSource property to a List<T> of the same type but with 1 item.  When I click to view the items I have 2 items instead of 1.

The Rows.Count = 2 but the DataSource.Count has 1.

I have tried setting DataSource to null before assigning it, tried DataBind() after assignment but no luck.

Please help