2

I have a model with a List of invoices. I am displaying this list of invoices in a grid. I would like to have a column of check boxes in the grid so I can perform some additional logic. How would I go about reading the values of these check boxes when I post? Basically what I need is to have a Html.CheckBoxFor in a column for each of the items in the list. I don't think that's possible but is there a way to have something similar?

Here's my grid:

<% Html.Grid(Model.Invoices)     
       .Attributes(@id => "tblInvoiceSearchResults", @class => "tablesorter", style => "width:100%")
       .Empty("No invoice exist with that criteria")
       .Columns(
        col =>
            {
              col.For(c => c.InvoiceNumber).Named("Invoice Number");
              col.For(c => c.InvoicePurchaseOrderNumber).Named("PurchaseOrder");
              col.For(c => c.InvoiceStatus).Named("Invoice Status");
              col.For(c => c.OpenAmount.ToMoneyDisplay()).Visible((bool)ViewData["canSeePricing"])
                    .Named("Open Amt").Attributes(align=>"right");
              col.For(c => c.OriginalAmount.ToMoneyDisplay()).Visible((bool)ViewData["canSeePricing"])
                    .Named("Original Amt")
                    .Attributes(align => "right"); 
              col.For(c => c.InvoiceDate).Named("Invoice Date");
        }).Render();
 %>
1
  • What grid library are you using? Or is this hand rolled? Commented Aug 30, 2011 at 19:43

1 Answer 1

1

After review, I'm taking a guess that you are using the mvccontrib-grid? If so take a look at this answer from DD: Mvc Contrib grid with checkbox

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.