dynamically adding edit cancel update

T

Tomk20

I've figured out how to add an edit button based on a login form but when
the user presses that edit button how to I get 2 buttons (Update & Cancel)
in the same column like it does when setup with the designer?




Private Sub DataGrid1_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Init

If Session("AdminMode") Then

'Create ID column & add to DataGrid

dgcAdmin.HeaderText = "Admin"

dgcAdmin.ButtonType = ButtonColumnType.PushButton

dgcAdmin.Text = "Edit"

dgcAdmin.CommandName = "Edit"

dgcAdmin.Visible = True

DataGrid1.Columns.AddAt(0, dgcAdmin)

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top