Hi Darin,
You want to create a template column, put your button items in it and set the
CommandName property for each. Then in your code, you catch the ItemCommand
event and evaluate which object cause the event. The .aspx stuff is first
below, then the event handler code.
<columns>
<asp:templatecolumn>
<itemtemplate>
<p>
<asp:linkbutton id="LinkButton1" runat="server"
causesvalidation="false" commandname="Navigate"
text="MultiAction" tooltip="Goes elsewhere">Navigate
Away</asp:linkbutton></p>
<p>
<asp:button id="Button1" runat="server" commandname="ShowTime"
text="Show Time"></asp:button></p>
<p>
<asp:imagebutton id="ImageButton1" runat="server"
commandname="MakeRed"
imageurl="
http://www.gc.ca/images/flag.gif"></asp:imagebutton></p>
<p>
<asp:linkbutton id="LinkButton2" runat="server"
commandname="Update" borderstyle="Solid"
bordercolor="#FFFFC0">Update</asp:linkbutton></p>
</itemtemplate>
</asp:templatecolumn>
<asp:boundcolumn datafield="UnitPrice"
dataformatstring="{0:C}"></asp:boundcolumn>
</columns>
Private Sub DataGrid1_ItemCommand _
(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.ItemCommand
Select Case e.CommandName
Case "Navigate"
Response.Redirect("
http://www.aspalliance.com/kenc")
Case "ShowTime"
Label1.Text = Now.ToLongTimeString
Case "Update"
Response.Write("<script>alert('This would update')</script>")
Case "MakeRed"
e.Item.BackColor = Color.Red
End Select
End Sub
I posted this question in the ASP.NET newsgroup not
knowing about this newsgroup.
I need to create a column with 4 links in that column
that take 4 different actions against that row when
clicked.
I do not see how to add 4 links under one column using
the datagrid's property builder.
Can anyone give me any direction or links to articles?
Thanks.
..