返回 Telerik 网格的特定视图
我有一个模型,其中包含客户记录,并且可以有与该客户相关的多个项目。
Html.Telerik().Grid<YeagerTechModel.Customer>
我在控制器中有两个操作。一种仅返回客户记录,另一种包含与其项目关联的客户记录。以下语法用于将数据绑定到视图。
IEnumerable<Customer> customerList = db.GetCustomers();
return View(new GridModel<Customer> { Data = customerList });
我打算设置两个单独的视图。上述每种情况各有一个。但是,由于上述语法包含可能项目的数据,我是否需要创建一个视图并隐藏项目网格(层次结构),或者我可以有两个单独的视图(一个仅包含客户,另一个包含客户及其关联项目的层次结构) )?
根据上面使用的语法,我似乎只能使用一个层次结构视图。
I have a model which contains a customer record and can have multiple projects pertaining to that customer.
Html.Telerik().Grid<YeagerTechModel.Customer>
I have two actions in the Controller. One that returns just the Customer records and the other one contains the Customer record associated with its Projects. The below syntax is for binding the data to the View.
IEnumerable<Customer> customerList = db.GetCustomers();
return View(new GridModel<Customer> { Data = customerList });
I was planning to set up two separate views. One for each of the scenarios described above. However, since the above syntax includes data for possible projects, do I need to make one View and hide the Projects grid (hierarchial) or can I have two separate views (one with just the Customers and another hierarchialone for the Customer and its associated Projects)?
According to the syntax that is used above, it seems that I can only use the one hierarchial view.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,它会是这样的:
Actually, it would be just like this: