View Single Post
  #7 (permalink)  
Old November 19th, 2006, 10:51 AM
jpullam jpullam is offline
Authorized User
 
Join Date: Oct 2006
Location: Toronto, Ontario, Canada.
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

After a lot of trial, error and searching of the Internet, I found a fairly elegant solution to this. Here is the code I now use:

Protected Sub DetailsView1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.PreRender
If DetailsView1.CurrentMode = DetailsViewMode.Insert Then
    Dim ThisControl As TextBox
    ThisControl = DetailsView1.FindControl("InsertEventName")
    ThisControl.Text = "new event"
    ThisControl = DetailsView1.FindControl("InsertDays")
    ThisControl.Text = "1"
    End if
End Sub



Reply With Quote