我在想是否有可能在telerik radgrid上做crud,数据是从一个linq到实体的。
我使用的是edmx,然后用linq查询得到的数据设置了Radgrid的数据源。这里是:
DatabaseModel.Entities entities = new DatabaseModel.Entities();
RadGrid1.DataSource = from courses in entities.Courses
select new {
courses.CourseName,
courses.CourseCode,
courses.Description
};
RadGrid1.DataBind();
雷达网是这样宣布的:
<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>
有什么办法可以这样编辑数据库内容吗?谢谢。