473,624 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListView ItemUpdating OldValues and NewValues collections Empty (linqDataSource )

Hi,

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

<asp:ListView ID="lvEditPerso nRoles" runat="server"
DataKeyNames="P ersonId,RoleEnt ityGroup"
DataSourceID="L DSPersonRoles"
OnItemUpdated=" lvEditPersonRol es_ItemUpdated"
OnItemUpdating= "lvEditPersonRo les_ItemUpdatin g">
<LayoutTemplate >
<table class="commonLi st">
<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="itemPlaceho lder" runat="server">
</tr>
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate >
<tr runat="server">
<td>
<asp:Label ID="RoleEntityG roupLabelReadOn ly"
runat="server" Text='<%# Eval("RoleEntit yGroup") %>'></asp:Label>
</td>
<td>
<asp:CheckBox ID="AllowListCh eckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowList ") %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowNewChe ckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowNew" ) %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowEditCh eckBoxReadOnly"
runat="server" Checked='<%# Eval("AllowEdit ") %>'
Enabled="False" />
</td>
<td>
<asp:CheckBox ID="AllowDelete CheckBoxReadOnl y"
runat="server" Checked='<%# Eval("AllowDele te") %>'
Enabled="False" />
</td>
<td nowrap>
<asp:LinkButt on ID="lbtEdit" runat="server"
CommandName="Ed it" Text="Edit" CssClass="i_edi t iconText"></asp:LinkButton>
</td>
<td>&nbsp;</td>
</tr>
</ItemTemplate>
<EditItemTempla te>
<tr runat="server">
<td runat="server">
<asp:Label ID="RoleEntityG roupLabel"
runat="server" Text='<%# Eval("RoleEntit yGroup") %>'></asp:Label>
</td>
<td runat="server">
<asp:CheckBox ID="AllowListCh eckBox"
runat="server" Checked='<%# Bind("AllowList ") %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowNewChe ckBox"
runat="server" Checked='<%# Bind("AllowNew" ) %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowEditCh eckBox"
runat="server" Checked='<%# Bind("AllowEdit ") %>' />
</td>
<td runat="server">
<asp:CheckBox ID="AllowDelete CheckBox"
runat="server" Checked='<%# Bind("AllowDele te") %>' />
</td>
<td nowrap="nowrap" runat="server">
<asp:LinkButt on ID="lbtUpdate" runat="server"
CommandName="Up date" Text="Update" CssClass="i_com plete
iconText"></asp:LinkButton>
&nbsp;&nbsp;&nb sp;
<asp:LinkButt on ID="lbtCancel" runat="server"
CommandName="Ca ncel" Text="Cancel"></asp:LinkButton>
</td>
<td runat="server"> &nbsp;</td>
</tr>
</EditItemTemplat e>
</asp:ListView>
<asp:LinqDataSo urce ID="LDSPersonRo les" runat="server"
ContextTypeName ="PMS.PMSDC"
TableName="Pers onRolesAdapters " EnableUpdate="T rue"
OrderBy="RoleEn tityGroup" Where="PersonId == @PersonId" >
<WhereParameter s>
<asp:QueryStrin gParameter DefaultValue="0 " Name="PersonId"
QueryStringFiel d="itemId" Type="Int32" />
</WhereParameters >
</asp:LinqDataSou rce>

dbml entity: (dbo.PersonsRol esAdapter is a view)

<Table Name="dbo.Perso nsRolesAdapter" Member="PersonR olesAdapters">
<Type Name="PersonRol esAdapter">
<Column Name="PersonId" Type="System.In t32" DbType="Int NOT NULL"
IsPrimaryKey="t rue" CanBeNull="fals e" />
<Column Name="RoleEntit yGroup" Type="System.St ring"
DbType="VarChar (100) NOT NULL" IsPrimaryKey="t rue" CanBeNull="fals e" />
<Column Name="AllowList " Type="System.Bo olean" DbType="Bit"
CanBeNull="fals e" />
<Column Name="AllowNew" Type="System.Bo olean" DbType="Bit"
CanBeNull="fals e" />
<Column Name="AllowEdit " Type="System.Bo olean" DbType="Bit"
CanBeNull="fals e" />
<Column Name="AllowDele te" Type="System.Bo olean" DbType="Bit"
CanBeNull="fals e" />
</Type>
<UpdateFuncti on FunctionId="Fun ctionId1">
<Argument Parameter="pers on_id" Member="PersonI d"
Version="Origin al" />
<Argument Parameter="role _entity" Member="RoleEnt ityGroup"
Version="Origin al" />
<Argument Parameter="allo w_list" Member="AllowLi st" />
<Argument Parameter="allo w_new" Member="AllowNe w" />
<Argument Parameter="allo w_edit" Member="AllowEd it" />
<Argument Parameter="allo w_delete" Member="AllowDe lete" />
</UpdateFunction>
</Table>
Jun 27 '08 #1
0 2858

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8351
by: Mark Olbert | last post by:
I ran into a situation this morning where the RowUpdating event of a GridView kept insisting there were no entries in either the OldValues or NewValues dictionaries. The GridView is bound to a strongly-typed collection, derived from CollectionBase, through the control's datasource property at runtime. From some googling it appears that, at least in the release candidate for NET2 this was a known bug; only binding to DataSources lets those...
1
2759
by: cisco | last post by:
I've been trying to figure out how the client of a DetailsView or FormView should handle the ItemUpdating event when setting the datasource programatically. I want to do something simple like this: formView.DataSource = new SomeUserObject { user }; formView.DataBind(); All the examples i've come across show a declerative data source being used. Do i need to use ObjectDataSource? I can get the information going through the cells by...
1
7727
by: Timothy H. Schilbach | last post by:
Hi Everyone, I am having a massive issue trying to get custom data into my DV. What I want to do is sooo simple: 1. I have a single DV on a page 2. I created my own template (see below) 3. I created the DetailsViewDataBinging sub which populates the field using a datatable 4. I created a ModeChanging Event handler to allow me to change the mode
3
3357
by: Haleigh | last post by:
I just started a few days ago, so I'm very new to this. I'm trying to update a gridview using a store procedure. When I am in the update subroutine, newvalues and oldvalues are empty, plus count is zero. Here is the code I have. What I really want to do is get the changed value for startdate and endate just before doing an update. Thanks <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"...
4
12507
by: anniebai | last post by:
Please help me with writing a RowUpdating function in C#, I don't know how to grab the current field's value and also get the old value for one of keys (which is ProjectName for editing) of the selected row. I've tried: e.Keys.Count, e.OldValues.Count, e.NewValues.Count -----------> all give zero Some said if TemplateField is used, e.Keys and Oldvalues, NewValues are all empty. Then what suppose to be used in such case? Thanks for any...
0
2124
by: =?Utf-8?B?UmFzbXVz?= | last post by:
I have a simple LiveView control that databinds to a LinqDataSource that maps to a table like this: CREATE TABLE MyTable (Id int NOT NULL, Name nvarchar(50) NULL, Picture image NULL) The OR mapper class (made in the VS 2008 designer) has a property of type System.Data.Linq.Binary
0
3547
by: =?iso-8859-2?Q?=A3ukasz_Led=F3chowski?= | last post by:
Hi! I am using FormView with SqlDataSource. The problem is that during ItemUpdating event of FormView, NewValues table is empty. OldValues has all values of fields bound on template. What can be the reason? -- Łukasz Ledóchowski GG: 503647 lukled@tlen.pl
0
2446
by: lightgram | last post by:
Hello I am having problems extracting the OldValues collection from the RowUpdating event in my GridView. Every time I access this I am getting the values from the NewValues collection in both OldValues and NewValues. I am fairly sure that the data is not being rebound prior to the updating event. I have posted my code below. Thanks in advance.
2
3355
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the 'values' dictionary contains values...." I am using a ListView with a DataSourceID of a LinqDataSource. When a new row icon is clicked....the ListView properly enters into the InsertItemTemplate....however when the ImageButton with a CommandName of...
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.