DataGridView Cannot clear this list.
  • hi i want to clear my datagridview rows and using code


    but it give exception
    Cannot clear this list.
  • 1 Comment sorted by
  • Vote Up0Vote Down ithackerithacker
    117.50 Karma Accepted Answer
    Hi i think you filling grid through .DataSource Property so you have to use below code for clear rows.

     if (dg.DataSource != null)
                    dg.DataSource = null;

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook


Popular Posts of the Week

    Optimum Creative