Home > Forum > Plugins > SDK Action

SDK Action
1

MVP

What would be the best method to remove rows from the item list of an instance inside an SDK plugin in order to make use of them in C# code?


I tried to remove rows from the item list in the code C# (SDK plugin ) using function :
WebCon.WorkFlow.SDK.Documents.Model.ItemsLists.ItemsList.RemoveAt(int index), but can't delete all the rows because I get the error from the image

MVP

Hi,

without knowing your code I will provide a general explanation.

Either you aren't trying to delete a row but an item list object or your index is of by 1.

While the rows start with 1 in the UI the index of the first row is 0. So if you want to remove row 4 you have to provide the index 3.
If you want to remove all you could use:

for (int i = 0; i < document.ItemsLists[0].Rows.Count; i++)
{
document.ItemsLists[0].Rows.RemoveAt(i)
}

Best regards,
Daniel