Hmmm, I am using the asp GridView:
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True"
AutoGenerateColumns="False"
CssClass="gridview"
AlternatingRowStyle-CssClass="even"
GridLines="None"
DataKeyNames="Id"
DataSourceID="gridDataSource" Width="328px"
onselectedindexchanged="GridView1_SelectedIndexChanged"
onrowcommand="GridView1_RowCommand" >
<Columns>
<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="LessonId" HeaderText="LessonId"
SortExpression="LessonId" />
<asp:BoundField DataField="Order" HeaderText="Order"
SortExpression="Order" />
<asp:TemplateField HeaderText="Questions..." ShowHeader="False">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "MaintainQuestions.aspx?PageId=" + Eval("Id") %>'
Text="Edit Questions" ToolTip="Edit Questions"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Order" ShowHeader="False">
<ItemTemplate>
<asp:Button ID="btnMoveUp" runat="server" Text="Move Up"
CommandName="MoveUp" CommandArgument='<%# Eval("Id") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="even" />
</asp:GridView>
and the datasource:
<llblgenpro:LLBLGenProDataSource2 ID="detailsDataSource" runat="server"
AdapterTypeName="em.DatabaseSpecific.DataAccessAdapter, emDBSpecific"
DataContainerType="EntityCollection"
EntityFactoryTypeName="em.FactoryClasses.PageEntityFactory, em"
onentityinserted="detailsDataSource_EntityInserted"
onentityinserting="detailsDataSource_EntityInserting"
ThrowExceptionOnIllegalFieldInput="True">
</llblgenpro:LLBLGenProDataSource2>
The Order field is the non nullable field in question. I cant see any events on the grid control which would fire in the case of an exception, and in any case I dont see why the grid would swallow when LivePersistance=true, and not swallow when LivePersistance=false - how would the grid know?
Table schema:
CREATE TABLE page
(
id serial NOT NULL,
lesson_id integer NOT NULL,
"order" integer NOT NULL,
page_text character varying(100),
CONSTRAINT page_pk PRIMARY KEY (id),
CONSTRAINT page_lesson FOREIGN KEY (lesson_id)
REFERENCES lesson ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (OIDS=FALSE);