FormView1.DefaultMode代表FormView預設的模式,所以若要變更預設模式,
請呼叫FormView1.ChangeMode( ) ,ChangeMode內分別為
FormViewMode.ReadOnly:唯獨
FormViewMode.Edit:更新
FormViewMode.Insert:插入
以下透過三個按鈕變更FormView1的模式
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.ReadOnly)
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.Edit)
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FormView1.ChangeMode(FormViewMode.Insert)
End Sub
沒有留言:
張貼留言