Author Topic: How can I delete rows from secondary in ClientTask  (Read 343 times)

Offline Misiu

  • Sr. Member
  • ****
  • Posts: 81
  • Karma: +0/-1
  • Gender: Male
    • View Profile
How can I delete rows from secondary in ClientTask
« on: January 30, 2018, 07:32:18 AM »
I'm trying to clear secondary (delete all rows from it).
My current approach is to iterate over DataSource or that secondary and  calling Delete

    for (int i = 0; i < (EmailAttachmentsDataGridView.DataSource as DataView).Table.Rows.Count; i++)
    {
        (EmailAttachmentsDataGridView.DataSource as DataView).Delete(i++);
    }

But maybe there is better way of doing this?

In my case I'm allowing user to add multiple files to secondary, if he clicks "Clear" I want to remove all of them.