.NET Hore....

simple beginner .NET geek
See also: Other Geeks@INDC

ASP .NET 2.0 Simple Trick ( II )

How to determine amount of record, thus formview will change its mode into insert mode if there is no record, and change it back to update mode if there is some records detected :

Put it in sub ItemCreated :

If FormView1.DataItemCount = 0 Then
  
FormView1.ChangeMode(FormViewMode.Insert)
Else
  
FormView1.ChangeMode(FormViewMode.Edit)
End If

Share this post: | | | |
Posted: Feb 16 2006, 10:02 PM by soetam | with 1 comment(s)
Filed under:

Comments

soetam said:

This doesn't work. It will always choose insert mode even if there is a record.
# April 7, 2006 12:57 PM