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 DetailsViewData Binging sub which populates the field using
a datatable
4. I created a ModeChanging Event handler to allow me to change the mode
into EDIT mode
5. I created a ItemUpdating mode to handle the item update.
No matter what I do or what I put in, the e.NewValues or e.OldValue
contain NOTHING... Whan I do a count I see 0 everytime. Non of my fields are
Template fields and they are all databound. Everything works with any
issues, just no data is ever returned.
I hope these shed some light:
DETAILSVIEW1
############### ############### ############### ############### #####
<asp:DetailsVie w ID="DetailsView 1" runat="server" Width="125px"
AutoGenerateRow s="False">
<Fields>
<asp:BoundFie ld DataField="Firs tName" HeaderText="Fir st Name:" />
<asp:BoundFie ld DataField="Last Name" HeaderText="Las t Name:" />
<asp:BoundFie ld DataField="Disp layName" HeaderText="Dis play Name:" />
<asp:BoundFie ld DataField="Desc ription" HeaderText="Des cription:" />
<asp:BoundFie ld DataField="Prim aryEmail" HeaderText="Pri mary Email:"
ReadOnly="True" />
<asp:CommandFie ld ShowEditButton= "True" ShowDeleteButto n="True" />
</Fields>
</asp:DetailsView >
Protected Sub DetailsView1_Mo deChanging(ByVa l sender As Object, ByVal e As
System.Web.UI.W ebControls.Deta ilsViewModeEven tArgs) Handles
DetailsView1.Mo deChanging
'# When the form mode changes we handle how the form loads and what it looks
like here
Select Case e.NewMode
'Put into edit mode and databind
Case DetailsViewMode .Edit
DetailsView1.Ch angeMode(Detail sViewMode.Edit)
'BindDetailsVie w()
'Put into insert mode
Case DetailsViewMode .Insert
'put into read only mode and databind
Case DetailsViewMode .ReadOnly
DetailsView1.Ch angeMode(Detail sViewMode.ReadO nly)
BindDetailsView ()
End Select
End Sub
Protected Sub DetailsView1_It emUpdating(ByVa l sender As Object, ByVal e As
System.Web.UI.W ebControls.Deta ilsViewUpdateEv entArgs) Handles
DetailsView1.It emUpdating
Response.Write( e.NewValues.Cou nt)
End Sub
What Else am I missing here? This is driving me batty as I cannotdo anything
with my data. All I want to do is intercept the NewValues and put them in my
custom data solution.
-Timothy