zoukankan      html  css  js  c++  java
  • My WebGrid

    namespace MvcWebGrid.Models
    {
        public class Customer
        {
            public string CustomerCode { get; set; }
            public string CustomerName { get; set; }
        }
    }

    namespace MvcWebGrid.Controllers
    {
        public class HomeController : Controller
        {
            //
            // GET: /Home/

            public ActionResult Index()
            {
                List<Customer> Custs = new List<Customer>();
                Custs.Add(new Customer{CustomerCode="1001",CustomerName="gan"});
                Custs.Add(new Customer{CustomerCode="1002",CustomerName="ting"});
                return View(Custs);
            }

        }
    }

    @model List<MvcWebGrid.Models.Customer>

    @{
        ViewBag.Title = "Index";
    }

    @{
        var grid = new WebGrid(Model,
            defaultSort:"CustomerCode",
            canPage: true
            );
        <div id="DivGrid">
            @grid.GetHtml(
            columns:grid.Columns(
                grid.Column("CustomerCode","Customer Code"),
                grid.Column("CustomerName","Customer Name")
            )
                   
            )
        </div>
    }

  • 相关阅读:
    Bye sent_keys
    快速获取Jenkins上build
    快速搞定selenium grid分布式
    python 图形界面开发
    [分享] 自动化测试与持续集成方案-- UI 检查
    hua ge ju hao
    暴力 C++
    简单排序(java)
    记codeforces两题
    hdu 1874, dijkstra
  • 原文地址:https://www.cnblogs.com/ganting/p/4811973.html
Copyright © 2011-2022 走看看