Hello!
I have a page with a Datagrid in it. This datagrid has a number of bound columns and one last template column that contains a linkbutton control.
This LinkButton has to open a new page when the user clicks on it, but this page has to receive a parameter depending on some data contained in one of the bound columns.
This is the definition of my Datagrid:
And the definition of the event handler:
Here, I have to change the value of the id field, and make it match the value contained in the boundcolumn codigoTarea.
Do you know how can I achieve that?
I have a page with a Datagrid in it. This datagrid has a number of bound columns and one last template column that contains a linkbutton control.
This LinkButton has to open a new page when the user clicks on it, but this page has to receive a parameter depending on some data contained in one of the bound columns.
This is the definition of my Datagrid:
Code:
<asp:DataGrid id="DatosTarea" Visible="False" ForeColor="Black" BackColor="White" BorderColor="Silver" Font-size="8pt" horizontalalign="left" cellpadding="4" AutoGenerateColumns="False" AllowSorting="True" OnSortCommand="Sort_Grid" runat="server">
<HeaderStyle font-bold="True" horizontalalign="Center" forecolor="White" backcolor="Navy"></HeaderStyle>
<AlternatingItemStyle BorderColor="White" BackColor="White"></AlternatingItemStyle>
<Columns>
<asp:BoundColumn id="codigoTarea" HeaderText="Codigo de Tarea" DataField="CodigoTarea" SortExpression="CodigoTarea" />
<asp:BoundColumn HeaderText="Descripcion" DataField="DescripcionCorta" SortExpression="DescripcionCorta" />
<asp:BoundColumn HeaderText="Estado" DataField="DescripcionEstado" SortExpression="DescripcionEstado" />
<asp:BoundColumn HeaderText="Empleado" DataField="CodigoEmpleado" SortExpression="CodigoEmpleado" />
<asp:TemplateColumn HeaderText="Ver Detalles">
<ItemTemplate>
<asp:linkButton id="accion" OnClick="CargarDetalle" runat="server">Detalle</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
And the definition of the event handler:
Code:
Sub CargarDetalle(sender As Object, e As System.EventArgs)
Response.Write("<script>")
Response.Write("window.open(TIdetalle.aspx?id=56,DetalleTareas,top=0,left=0,width=800,height=600,status=yes,resizable=yes,scrollbars=yes);")
Response.Write("</" & "script>")
End Sub
Here, I have to change the value of the id field, and make it match the value contained in the boundcolumn codigoTarea.
Do you know how can I achieve that?