I am trying to replace my ObjectDataSoure with LLBLGenProDataSource2, and I've hit a difference which I'm not sure how to work around:
I have a GridView and a DetailsView both bound to the same data source (either an ObjectDataSource or LLBLGenProDataSource2). The DetailsView allows inserts, and when using the ObjectDataSource, the GridView is automatically updated after the insert to reflect the new row whereas with the LLBLGenProDataSource2 this does not happen. Is this by design and if so how can I tell the grid it needs to reload (LLBLGenProDataSource2 .Refetch is already = true in the DetailView.ItemInserted event)?
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MaintainCourses.aspx.cs" Inherits="MaintainCourses" Title="Untitled Page" %>
<%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" Namespace="SD.LLBLGen.Pro.ORMSupportClasses"
TagPrefix="llblgenpro" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp
ropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp
ropDownList>
<br />
<br />
<div class="todoheader">
Courses
</div>
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True"
AutoGenerateColumns="False"
CssClass="gridview"
AlternatingRowStyle-CssClass="even"
GridLines="None"
DataKeyNames="Id"
DataSourceID="ObjectDataSource1" Width="328px" >
<Columns>
<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Id" ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="CategoryId" HeaderText="Category"
SortExpression="CategoryId" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
</Columns>
<AlternatingRowStyle CssClass="even" />
</asp:GridView>
<div class="insertheader">
Add a new course
</div>
<asp
etailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False" DataSourceID="ObjectDataSource1" DefaultMode="Insert"
CssClass="detailsview"
GridLines="None">
<Fields>
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="CategoryId" HeaderText="Category"
SortExpression="CategoryId" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp
etailsView>
<llblgenpro:LLBLGenProDataSource2 ID="LLBLGenProDataSource1" runat="server"
AdapterTypeName="em.DatabaseSpecific.DataAccessAdapter, emDBSpecific"
DataContainerType="EntityCollection"
EntityFactoryTypeName="em.FactoryClasses.CourseEntityFactory, em" >
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="CategoryId"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</llblgenpro:LLBLGenProDataSource2>
<asp
bjectDataSource ID="ObjectDataSource1" runat="server"
DataObjectTypeName="em.EntityClasses.CourseEntity" InsertMethod="Insert"
SelectMethod="FetchByCategoryId" TypeName="xxx.CourseService"
UpdateMethod="Insert">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="CategoryId"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp
bjectDataSource>
</asp:Content>