无法将带有 [] 的索引应用于 'ISet<string>' 类型的表达式

Cannot apply indexing with [] to an expression of type 'ISet<string>'

我收到错误 '无法将 [] 的索引应用到 'ISet' 类型的表达式'

对于此代码段

foreach (GridViewRow grv in customTableDataList.UniGrid.GridView.Rows)
{
  if (grv != null)
  {
    if (null != grv.FindControl(ItemCheckBoxID) && ((CheckBox)grv.FindControl(ItemCheckBoxID)).Checked)
    {
      //At this line I am getting error.
      itemIds += customTableDataList.UniGrid.ActionsID[rowCounter] + ", ";  
    }
    rowCounter++;
  }
}

任何人都可以提供更多细节来解决这个问题。

添加新的使用:

System.Linq;

并改变

foreach (GridViewRow grv in customTableDataList.UniGrid.GridView.Rows)
{
  if (grv != null)
  {
    if (null != grv.FindControl(ItemCheckBoxID) && ((CheckBox)grv.FindControl(ItemCheckBoxID)).Checked)
    {
      itemIds += customTableDataList.UniGrid.ActionsID.ToArray()[rowCounter] + ", ";
    }
    rowCounter++;
  }
}