【发布时间】:2010-02-25 23:15:49
【问题描述】:
我在想是否可以在 Telerik radgrid 上进行 crud,并且数据是从 linq 到实体的。
我使用的是 edmx,然后我使用 linq 查询产生的数据设置了 Radgrid 的 DataSource。就是这样:
DatabaseModel.Entities entities = new DatabaseModel.Entities();
RadGrid1.DataSource = from courses in entities.Courses
select new {
courses.CourseName,
courses.CourseCode,
courses.Description
};
RadGrid1.DataBind();
Radgrid 是这样声明的:
<telerik:RadGrid ID="RadGrid1" runat="server"
AllowAutomaticDeletes="true" AllowAutomaticInserts="true"
AllowAutomaticUpdates="true" AllowPaging="True"
AutoGenerateDeleteColumn="True" EnableHeaderContextMenu="True"
AllowFilteringByColumn="True" AllowSorting="True" AutoGenerateEditColumn="True">
<MasterTableView CommandItemDisplay="Top" >
</MasterTableView>
</telerik:RadGrid>
有什么办法可以这样编辑数据库内容吗?非常感谢。
【问题讨论】:
标签: linq-to-entities telerik crud radgrid