ListView ItemUpdating OldValues and NewValues collections Empty (linqDataSource)

M

Marius Manolea

Hi,

I have a strange problem, I don't receive any modifications from
listview in edit mode (OldValues & NewValues are empty)



<asp:ListView ID="lvEditPersonRoles" runat="server"
DataKeyNames="PersonId,RoleEntityGroup"
DataSourceID="LDSPersonRoles"
OnItemUpdated="lvEditPersonRoles_ItemUpdated"
OnItemUpdating="lvEditPersonRoles_ItemUpdating">
<LayoutTemplate>
<table class="commonList">
<thead>
<tr>
<th class="sortable" nowrap style="width:
300px">
<a href="#">Entity / Role</a>
</th>
<th class="sortable" nowrap style="width:
50px">
<a href="#">List</a>
</th>
<th class="sortable" nowrap style="width:
50px">
<a href="#">New</a>
</th>
<th class="sortable" nowrap style="width:
50px">
<a href="#">Update</a>
</th>
<th class="sortable" nowrap style="width:
50px">
<a href="#">Delete</a>
</th>
<th nowrap style="width: 150px">
&nbsp;
</th>
<th style="width: 60%">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr id="itemPlaceholder" runat="server">
</tr>
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr runat="server">
<td>
<asp:Label ID="RoleEntityGroupLabelReadOnly"
runat="server" Text='<%# Eval("RoleEntityGroup") %>'></asp:Label>
</td>
<td>
<asp:CheckBox ID="AllowListCheckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowList") %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowNewCheckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowNew") %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowEditCheckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowEdit") %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowDeleteCheckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowDelete") %>'
Enabled="False" />
</td>
<td nowrap>
<asp:LinkButton ID="lbtEdit" runat="server"
CommandName="Edit" Text="Edit" CssClass="i_edit iconText"></asp:LinkButton>
</td>
<td>&nbsp;</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr runat="server">
<td runat="server">
<asp:Label ID="RoleEntityGroupLabel"
runat="server" Text='<%# Eval("RoleEntityGroup") %>'></asp:Label>
</td>
<td runat="server">
<asp:CheckBox ID="AllowListCheckBox"
runat="server" Checked='<%# Bind("AllowList") %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowNewCheckBox"
runat="server" Checked='<%# Bind("AllowNew") %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowEditCheckBox"
runat="server" Checked='<%# Bind("AllowEdit") %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowDeleteCheckBox"
runat="server" Checked='<%# Bind("AllowDelete") %>' />
</td>
<td nowrap="nowrap" runat="server">
<asp:LinkButton ID="lbtUpdate" runat="server"
CommandName="Update" Text="Update" CssClass="i_complete
iconText"></asp:LinkButton>
&nbsp;&nbsp;&nbsp;
<asp:LinkButton ID="lbtCancel" runat="server"
CommandName="Cancel" Text="Cancel"></asp:LinkButton>
</td>
<td runat="server">&nbsp;</td>
</tr>
</EditItemTemplate>
</asp:ListView>
<asp:LinqDataSource ID="LDSPersonRoles" runat="server"
ContextTypeName="PMS.PMSDC"
TableName="PersonRolesAdapters" EnableUpdate="True"
OrderBy="RoleEntityGroup" Where="PersonId == @PersonId" >
<WhereParameters>
<asp:QueryStringParameter DefaultValue="0" Name="PersonId"
QueryStringField="itemId" Type="Int32" />
</WhereParameters>
</asp:LinqDataSource>



dbml entity: (dbo.PersonsRolesAdapter is a view)

<Table Name="dbo.PersonsRolesAdapter" Member="PersonRolesAdapters">
<Type Name="PersonRolesAdapter">
<Column Name="PersonId" Type="System.Int32" DbType="Int NOT NULL"
IsPrimaryKey="true" CanBeNull="false" />
<Column Name="RoleEntityGroup" Type="System.String"
DbType="VarChar(100) NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
<Column Name="AllowList" Type="System.Boolean" DbType="Bit"
CanBeNull="false" />
<Column Name="AllowNew" Type="System.Boolean" DbType="Bit"
CanBeNull="false" />
<Column Name="AllowEdit" Type="System.Boolean" DbType="Bit"
CanBeNull="false" />
<Column Name="AllowDelete" Type="System.Boolean" DbType="Bit"
CanBeNull="false" />
</Type>
<UpdateFunction FunctionId="FunctionId1">
<Argument Parameter="person_id" Member="PersonId"
Version="Original" />
<Argument Parameter="role_entity" Member="RoleEntityGroup"
Version="Original" />
<Argument Parameter="allow_list" Member="AllowList" />
<Argument Parameter="allow_new" Member="AllowNew" />
<Argument Parameter="allow_edit" Member="AllowEdit" />
<Argument Parameter="allow_delete" Member="AllowDelete" />
</UpdateFunction>
</Table>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,057
Messages
2,570,443
Members
47,113
Latest member
XZJMike318

Latest Threads

Top