1

I'm trying to put into webgrid collection

public class MyClass()
{
    List<Row> rows {get; set;}
}

public class Row()
{
    public string code {get; set;}
}

grid.Column("Amount",
format: @<text>
@Html.TextBoxFor(model => model.rows.FirstOrDefault().code, new { @class = "edit-mode", size = 5 })
</text>),

Using model.rows.FirstOrDefault().code it works but returns first element of collection in each row.

model.rows.GetEnumerator().Current.code returns nothing

How to get right desision to get each element of collection in own row

ekad
  • 14,436
  • 26
  • 44
  • 46
dm k
  • 111
  • 3
  • 9

1 Answers1

0

Source:

Used this format: InputExtensions.TextBox(Html, "Last Name", item.LastName) // static call

Community
  • 1
  • 1
dm k
  • 111
  • 3
  • 9