S
sck10
Hello,
I have a GridView that list all the employees in our group. My select
button (link) when clicked will open a DetailsView control of the employee
selected. I have one BoundField in the form that I want to fill in
programatically ("UpdatedBy"). So when the user selects the "edit" link,
the field is pre-populated with this value. This value needs to submitted
when the user clicks "update". Any help with this would be greatly
appreciated...
<aspetailsView ID="dvDetail"
....
<Fields>
<asp:BoundField DataField="UpdatedBy" HeaderText="Updated By"
ReadOnly="true" SortExpression="UpdatedBy" />
</Fields>
I am using the following to set the value, but getting the error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Protected Sub dvDetail_ModeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dvDetail.ModeChanged
Dim txtUpdatedBy As TextBox = CType(Me.dvDetail.FindControl("UpdatedBy"),
TextBox)
txtUpdatedBy.Text = "sckeels"
End Sub
I have a GridView that list all the employees in our group. My select
button (link) when clicked will open a DetailsView control of the employee
selected. I have one BoundField in the form that I want to fill in
programatically ("UpdatedBy"). So when the user selects the "edit" link,
the field is pre-populated with this value. This value needs to submitted
when the user clicks "update". Any help with this would be greatly
appreciated...
<aspetailsView ID="dvDetail"
....
<Fields>
<asp:BoundField DataField="UpdatedBy" HeaderText="Updated By"
ReadOnly="true" SortExpression="UpdatedBy" />
</Fields>
I am using the following to set the value, but getting the error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Protected Sub dvDetail_ModeChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dvDetail.ModeChanged
Dim txtUpdatedBy As TextBox = CType(Me.dvDetail.FindControl("UpdatedBy"),
TextBox)
txtUpdatedBy.Text = "sckeels"
End Sub