G
Guest
Hello,
I have a datagrid and the data in it is dynamically created at runtime...
For iCounter = 0 To dataset.Tables(0).Columns.Count - 1
Dim objbc As New BoundColumn()
With objbc
.DataField = dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
.HeaderText = dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
If .DataField = dsAllPastReplies.Tables(0).Columns("ReplyID").ColumnName Then
.Visible = False
End If
End With
With datagrid1
.Columns.Add(objbc)
.DataSource = dsAllPastReplies.Tables(0)
.DataBind()
End With
Next
dsAllPastReplies.Clear()
I can add a column of buttons at design time, but how can I fire off some javascript when a button is clicked? I would ultimately like to have a user click one of the buttons and data in the corresponding row for a given column would come up in a popup window. I have the javascript to do the popup, but I cant figure out how to call it from the dynamically created buttons.
I have a datagrid and the data in it is dynamically created at runtime...
For iCounter = 0 To dataset.Tables(0).Columns.Count - 1
Dim objbc As New BoundColumn()
With objbc
.DataField = dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
.HeaderText = dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
If .DataField = dsAllPastReplies.Tables(0).Columns("ReplyID").ColumnName Then
.Visible = False
End If
End With
With datagrid1
.Columns.Add(objbc)
.DataSource = dsAllPastReplies.Tables(0)
.DataBind()
End With
Next
dsAllPastReplies.Clear()
I can add a column of buttons at design time, but how can I fire off some javascript when a button is clicked? I would ultimately like to have a user click one of the buttons and data in the corresponding row for a given column would come up in a popup window. I have the javascript to do the popup, but I cant figure out how to call it from the dynamically created buttons.