English 中文(简体)
B. 用于网球的原始数据表
原标题:Bind Datatable to webgrid in mvc3

MVC3 Hi I have to bind the Datatable to webgrid in mvc3 also i have to apply paging for the same. but i am confused should i have to create a model for this or simply i can bind the datatable which contains complex column data to webgrid.

I have same datatable in asp where i simply bind it to grid datasource property. But i m not finding any ways to accomplish it in mvc3

我必须建立红树结构。

          Reservation                               
Day Date              Time  CustomerName    Party Size      Type    
TUE 13/01/2011        7.00  Sachin Marne    10               P1
                      08.30 Sagar Wagh      20               P2
TUE 14/01/2011        7.00  Sachin Marne    10               P1
                      08.30 Sachin Marne    20               P2
                      08.00 Sachin Marne    10               P1
                      08.30 Sachin Marne    20               P2

Please any one has any idea, Please suggest. Thanks, Sachin.

问题回答

我建议你建立一个观点模式:

public class ReservationViewModel
{
    public string Day { get; set; }
    public DateTime Date { get; set; }
    public string CustomerName { get; set; }
    public int PartySize { get; set; }
    public string Type { get; set; }
}

之后,你的控制者采取行动,询问贵国的存放处如何填写数据表,然后将其绘制成<代码>。 缩略语 这正是你会采纳的观点。 本着这一观点,您可从以下观点模式建立网页:





相关问题
Using jquery to get a partial view and updating the UI

I need to render a partial view (returned from the controller) to show some customer summary details. This will need to happen when the user clicks on a button. In the the mean time the user can ...

MVC 2 / MVC 3 / MVC 4

MVC 2 我们可以轻松地创造领域。 现在,我的问题涉及nes地区(地区内)。

Asp.Net MVC 2 - Changing the PropertyValueRequired string

Using a resx file in the App_GlobalResources directory, I ve been able to change the default message for the PropertyValueInvalid string of the model validators. But it doesn t work to translate the ...

ASP.NET MVC 3 - What features do you want to see? [closed]

I know a bunch of people that are really enjoying the improvements that ASP.NET MVC 2 made over the first release. I have just started to migrate our MVC 1 project over and so far areas has totally ...

热门标签