vb.net datagridview button
Posted on 2006-10-30
I have a datagridview where I insert a button.
I call the same function many times which gets a dataset from a db, then sets it to the grid.
After that I add the button with the code below.
Each time I call the function, a new button is created, how do I only do it if it does not exist?
Dim buttons As New DataGridViewButtonColumn()
.HeaderText = "Delete"
.Text = "Delete"
.UseColumnTextForButtonValue = True
.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells
.FlatStyle = FlatStyle.Standard
.DisplayIndex = 0