I used the telerik radgrid. Not sure how to tell which version it is? In Telerik.Web.UI property "version" the value is 2011.3.1115.35. Runtime version is v2.0.50727.
I am using just the default delete (not my own code) against an entity framework datasource see below, but the delete gives an exception in my entity framework code..
Here is the code
<asp:EntityDataSource ID="EntityDataSourceProducts" runat="server" ConnectionString="name=ApogeeCentralEntities" DefaultContainerName="ApogeeCentralEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Products" >
</asp:EntityDataSource>
<telerik:RadGrid ID="gridSPCs"
runat="server"
AutoGenerateColumns="True"
ShowGroupPanel="True"
GridLines="None"
AllowSorting="True"
DataSourceID="EntityDataSourceProducts"
AllowAutomaticDeletes="True"
AllowAutomaticUpdates="True"
AllowAutomaticInserts="True"
AllowScroll = "True"
Width="99.9%"
AllowFilteringByColumn="True"
AllowMultiRowSelection="True"
EnableLinqExpressions="false"
ItemStyle-VerticalAlign="Top"
PageSize="25"
AutoGenerateEditColumn="true"
AutoGenerateDeleteColumn="true"
MasterTableView-ClientDataKeyNames="Id"
GroupPanel-ForeColor="#cccccc"
>
<ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true">
<Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="300" AllowColumnRevertAnimation="true" />
<Selecting AllowRowSelect="true" />
<Scrolling UseStaticHeaders="true" AllowScroll="true" ScrollHeight="400px" />
<Resizing AllowColumnResize="true" ClipCellContentOnResize="false" EnableRealTimeResize="true" />
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true" />
</telerik:RadGrid>
When I try to delete one of the rows, I get an exception in the entity designer code
The exception is..
The property 'Name' cannot be set to a null value.
Here is the code where the exception happens
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String Name
{
get
{
return _Name;
}
set
{
OnNameChanging(value);
ReportPropertyChanging("Name");
_Name = StructuralObject.SetValidValue(value, false, "Name");//this line gives exception
ReportPropertyChanged("Name");
OnNameChanged();
}
}
Edits are working fine, this is just on DELETE that I am getting this error!! Any ideas?
Thanks for your help in advance!
By the way I just realized it only gives this error if the name is null in the data being deleted but still not sure why? Why does it matter if the name is null if the row is just being deleted?
I am using just the default delete (not my own code) against an entity framework datasource see below, but the delete gives an exception in my entity framework code..
Here is the code
<asp:EntityDataSource ID="EntityDataSourceProducts" runat="server" ConnectionString="name=ApogeeCentralEntities" DefaultContainerName="ApogeeCentralEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Products" >
</asp:EntityDataSource>
<telerik:RadGrid ID="gridSPCs"
runat="server"
AutoGenerateColumns="True"
ShowGroupPanel="True"
GridLines="None"
AllowSorting="True"
DataSourceID="EntityDataSourceProducts"
AllowAutomaticDeletes="True"
AllowAutomaticUpdates="True"
AllowAutomaticInserts="True"
AllowScroll = "True"
Width="99.9%"
AllowFilteringByColumn="True"
AllowMultiRowSelection="True"
EnableLinqExpressions="false"
ItemStyle-VerticalAlign="Top"
PageSize="25"
AutoGenerateEditColumn="true"
AutoGenerateDeleteColumn="true"
MasterTableView-ClientDataKeyNames="Id"
GroupPanel-ForeColor="#cccccc"
>
<ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true">
<Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="300" AllowColumnRevertAnimation="true" />
<Selecting AllowRowSelect="true" />
<Scrolling UseStaticHeaders="true" AllowScroll="true" ScrollHeight="400px" />
<Resizing AllowColumnResize="true" ClipCellContentOnResize="false" EnableRealTimeResize="true" />
</ClientSettings>
<GroupingSettings ShowUnGroupButton="true" />
</telerik:RadGrid>
When I try to delete one of the rows, I get an exception in the entity designer code
The exception is..
The property 'Name' cannot be set to a null value.
Here is the code where the exception happens
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String Name
{
get
{
return _Name;
}
set
{
OnNameChanging(value);
ReportPropertyChanging("Name");
_Name = StructuralObject.SetValidValue(value, false, "Name");//this line gives exception
ReportPropertyChanged("Name");
OnNameChanged();
}
}
Edits are working fine, this is just on DELETE that I am getting this error!! Any ideas?
Thanks for your help in advance!
By the way I just realized it only gives this error if the name is null in the data being deleted but still not sure why? Why does it matter if the name is null if the row is just being deleted?