2

I'm using Telerik grid view and I can't get access to my column in this code:

foreach (var Row in radGridView1.Rows)
{
    _MyAmount.Add((int)Row["Amount"].Text);
}

The code above first converts and after that fills a list.

I keep receiving this error:

'Telerik.WinControls.UI.GridViewRowInfo.this[Telerik.WinControls.UI.GridViewColumn]' is inaccessible due to its protection level

And in this part Row["Amount"]. in the bracket I should type column name, am I right?

What should I do to fix the error?

Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75

1 Answers1

0

Try this

foreach (GridDataItem Row in radGridView1.Items)
{
  _MyAmount.Add((int)Row["Amount"].Text);
}
Imad
  • 7,126
  • 12
  • 55
  • 112