обновление:
вот что я заметил:
if i get org.Registrations.Count = 1 then
txtBox.ID "_registration0_0" string
....
....
если я получу org.Registrations.Count = 2, тогда его поступок странный
txtBox.ID "_registration2_0"
txtBox.ID "_registration2_1"
after that i starts again with _registration2_0
ps: у меня нет проблем, если count = 1
конец обновления
в сообщениях об ошибках ясно сказано, что я пытаюсь получить дубликат идентификатора, нониже, где я создаю динамическое текстовое поле, вы видите, что не так в моем коде?
protected void gv_RowCreated(object sender, GridViewRowEventArgs e)
{
Students org = (namespace.Students )(e.Row.DataItem);
foreach (Registration reg in org.Registrations)
{
int _count = org.Registrations.Count;
for (int rowId = 0; rowId < _count; rowId++)
{
TextBox txtBox = new TextBox();
txtBox.ID = "_registration" + e.Row.RowIndex + "_" + rowId;
txtBox.Text = reg.Name;
e.Row.Cells[7].Controls.Add(txtBox);
}
}
}