By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

ListView ItemUpdating OldValues and NewValues collections Empty (linqDataSource)

P: n/a
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>
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.