By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 2,858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

build a personalized link on a datagrid

P: n/a
I want a row of the datagrid with a personalized link. The fields of the
link are on the select related to the datagrid
the link would be accoiones.aspx?iddireccion=2&idindicador=5

I tried this but doesnt work
<ItemTemplate>

<asp:HyperLink runat="server" id="Hyperlink2"
NavigateUrl='acciones.aspx?iddireccion='<%#
DataBinder.Eval(Container,"DataItem.iddireccion"%> '&idindicador='<%#
DataBinder.Eval(Container,"DataItem.idindicador"%> '>link</asp:HyperLink>
</ItemTemplate>
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello,

I use:

<asp:HyperLinkColumn Text="delete"
DataNavigateUrlField="HardwareAssetCFId"
DataNavigateUrlFormatString="StandardFields.aspx?d elete={0}">
<HeaderStyle HorizontalAlign="Left"
CssClass="gridHeader"></HeaderStyle>
<ItemStyle CssClass="gridFirstItem"></ItemStyle>
</asp:HyperLinkColumn>

The property Text will be displayed for every row, and the
DataNavigateUrlField, DataNavigateUrlFormatString together let you create
the link,

Greets,
Gab

"Luis E Valencia" <lu*******@haceb.com> schreef in bericht
news:eD**************@TK2MSFTNGP12.phx.gbl...
I want a row of the datagrid with a personalized link. The fields of the
link are on the select related to the datagrid
the link would be accoiones.aspx?iddireccion=2&idindicador=5

I tried this but doesnt work
<ItemTemplate>

<asp:HyperLink runat="server" id="Hyperlink2"
NavigateUrl='acciones.aspx?iddireccion='<%#
DataBinder.Eval(Container,"DataItem.iddireccion"%> '&idindicador='<%#
DataBinder.Eval(Container,"DataItem.idindicador"%> '>link</asp:HyperLink>
</ItemTemplate>

Nov 18 '05 #2

P: n/a
I didnt understand.

This is the code that fills that datagrid

Public Sub pasar(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )

If IsPostBack Then

Dim iddireccion As Int16 = dgdir.DataKeys(e.Item.ItemIndex)

'lblmetas.Text = "Indicadores para la direccion seleccionada"

Dim selectCMD2 As SqlCommand = New SqlCommand("select * from tblrelinddir,
tblheaderindicador where
tblheaderindicador.idindicador=tblrelinddir.idindi cador and
tblrelinddir.iddireccion=" & iddireccion & "", SqlConnection1)

selectCMD2.CommandTimeout = 30

Dim custDA2 As SqlDataAdapter = New SqlDataAdapter

custDA2.SelectCommand = selectCMD2

Dim custDS2 As DataSet = New DataSet

custDA2.Fill(custDS2, "tblindicadormeta")

dgmetas.DataSource = custDS2.Tables("tblindicadormeta").DefaultView

If custDS2.Tables("tblindicadormeta").Rows.Count = 0 Then

' lblmetas.Text = "NO hay indicadores en esta direccion"

dgmetas.Visible = False

' panelmeta.Visible = False

Else

dgmetas.DataBind()

dgmetas.Visible = True

'panelmeta.Visible = False

End If

End If

End Sub

and I need two fields on the link that are on the table called RELINDDIR a
fiels is called idireccion and the other is idindicador

and I want the link to show acciones.aspx?idindicador=2&iddireccion=4

can u help me a little more?

"GabriŽl" <sp**@adiso.nl> escribiů en el mensaje
news:10*************@corp.supernews.com...
Hello,

I use:

<asp:HyperLinkColumn Text="delete"
DataNavigateUrlField="HardwareAssetCFId"
DataNavigateUrlFormatString="StandardFields.aspx?d elete={0}">
<HeaderStyle HorizontalAlign="Left"
CssClass="gridHeader"></HeaderStyle>
<ItemStyle CssClass="gridFirstItem"></ItemStyle>
</asp:HyperLinkColumn>

The property Text will be displayed for every row, and the
DataNavigateUrlField, DataNavigateUrlFormatString together let you create
the link,

Greets,
Gab

"Luis E Valencia" <lu*******@haceb.com> schreef in bericht
news:eD**************@TK2MSFTNGP12.phx.gbl...
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid
the link would be accoiones.aspx?iddireccion=2&idindicador=5

I tried this but doesnt work
<ItemTemplate>

<asp:HyperLink runat="server" id="Hyperlink2"
NavigateUrl='acciones.aspx?iddireccion='<%#
DataBinder.Eval(Container,"DataItem.iddireccion"%> '&idindicador='<%#
DataBinder.Eval(Container,"DataItem.idindicador"%> '>link</asp:HyperLink>
</ItemTemplate>


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.