T
Timothy H. Schilbach
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
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
etailsView ID="DetailsView1" runat="server" Width="125px"
AutoGenerateRows="False">
<Fields>
<asp:BoundField DataField="FirstName" HeaderText="First Name:" />
<asp:BoundField DataField="LastName" HeaderText="Last Name:" />
<asp:BoundField DataField="DisplayName" HeaderText="Display Name:" />
<asp:BoundField DataField="Description" HeaderText="Description:" />
<asp:BoundField DataField="PrimaryEmail" HeaderText="Primary Email:"
ReadOnly="True" />
<asp:CommandField ShowEditButton="True" ShowDeleteButton="True" />
</Fields>
</asp
etailsView>
Protected Sub DetailsView1_ModeChanging(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewModeEventArgs) Handles
DetailsView1.ModeChanging
'# 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.ChangeMode(DetailsViewMode.Edit)
'BindDetailsView()
'Put into insert mode
Case DetailsViewMode.Insert
'put into read only mode and databind
Case DetailsViewMode.ReadOnly
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
BindDetailsView()
End Select
End Sub
Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles
DetailsView1.ItemUpdating
Response.Write(e.NewValues.Count)
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
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
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
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
AutoGenerateRows="False">
<Fields>
<asp:BoundField DataField="FirstName" HeaderText="First Name:" />
<asp:BoundField DataField="LastName" HeaderText="Last Name:" />
<asp:BoundField DataField="DisplayName" HeaderText="Display Name:" />
<asp:BoundField DataField="Description" HeaderText="Description:" />
<asp:BoundField DataField="PrimaryEmail" HeaderText="Primary Email:"
ReadOnly="True" />
<asp:CommandField ShowEditButton="True" ShowDeleteButton="True" />
</Fields>
</asp
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Protected Sub DetailsView1_ModeChanging(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewModeEventArgs) Handles
DetailsView1.ModeChanging
'# 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.ChangeMode(DetailsViewMode.Edit)
'BindDetailsView()
'Put into insert mode
Case DetailsViewMode.Insert
'put into read only mode and databind
Case DetailsViewMode.ReadOnly
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
BindDetailsView()
End Select
End Sub
Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles
DetailsView1.ItemUpdating
Response.Write(e.NewValues.Count)
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