Click here to Skip to main content
15,997,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
can any one tell me how to find control in edititemtemplate using
formview control....

Thanks in advance
Posted
Updated 3-Jan-10 22:39pm
v2

Google tells me these are web classes, yet you didn't say so, or mark your post as ASP.NET ? Why do you need to find the control ? What are you trying to do ? The MSDN samples show how to iterate over the data returned, and you can easily handle the events of the controls in the template, by adding the code to do so, if you need to.
 
Share this answer
 
Hi,
I wrote following code for that but it was not work.

Protected Sub fvDise_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles fvDise.PreRender
If fvDise.CurrentMode = FormViewMode.Edit Then
Dim label As TextBox = fvDise.FindControl("lblneDisease1")
Else
Dim label1 As Label = fvDise.FindControl("lbleDisease1")
End If
End Sub

i call mode changed event also but no use...
plz help me...
 
Share this answer
 
Hi,
I solved my problem using following code....

Protected Sub fvDise_Databound(ByVal sender As Object, ByVal e As System.EventArgs) Handles fvDise.Databound

If fvDise.CurrentMode = FormViewMode.Edit Then
CType(fvOther.FindControl("lbleDrivingLicense"), Label).Text="sometext"
Else
CType(fvOther.FindControl("lblDrivingLicense"), Label).Text="sometext"
End If

End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900