Hi
I want to add 2 buttons dynamically in the datagrid itemdatabound. I'm using the following code.
Private Sub dgData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgData.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.SelectedItem Then
Dim i As Int16, x As Int16
For i = 0 To e.Item.Cells.Count - 1
btn.Text = "Cancel Visit"
btn.CommandName = "Cancel_click"
btn.EnableViewState = True
Next
My question is where & how do I then get the button to fire?
Cheers
Lbob
I want to add 2 buttons dynamically in the datagrid itemdatabound. I'm using the following code.
Private Sub dgData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgData.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.SelectedItem Then
Dim i As Int16, x As Int16
For i = 0 To e.Item.Cells.Count - 1
btn.Text = "Cancel Visit"
btn.CommandName = "Cancel_click"
btn.EnableViewState = True
Next
My question is where & how do I then get the button to fire?
Cheers
Lbob