1: Thinking
WebGrid is a table, a row of records, represents a model, so we only need to build a model in the Models folder, in the Controller generation model list, the list as a model into the view (or binding strongly typed view, this type is at least equal to this model list), and then through the gethtml (model,propetieslist). Very simple.
Some of the properties and methods of WebGrid are described below (this is especially true in setting the table row and column field property pagination sort)
Ajaxupdatecallback: callback function after completion of asynchronous operation
Ajaxupdatecontainerid: Update included elements
Cansort: Whether sorting is supported
ColumnNames: Column Name list, similar to database field list, usually we use list<string> type
Hasselection: Selection of the decision row
Isajaxenabled Returns A value that indicates whether the WebGrid instance can use Ajax calls to refresh the display
Similar to the number of rows, default selection, paging, how many rows per page, and so on, refer to MSDN.
Please refer to the original text, thank the author.
WebGrid use and understanding in ASP. NET MVC (translation)