Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add navigateurl to hyperlink in gridview
    primarykey
    data
    text
    <p>Every row in my gridview is supposed to have a button/hyperlink that navigates to Page?id=<strong>something</strong> Then there's javascript that catches the redirect and prints the page as an iframe. This <strong>something</strong> is and already available in the row (but hidden). So i'd want to do something like NavigateUrl = "~/Page.aspx?id=" + Id.ToString() for each field, but the thing is the Id is populated in DataBind() from a LINQ datasource.</p> <pre><code>&lt;asp:GridView ID="gridleitNidurstada" runat="server" GridLines="None" AllowPaging="True" CssClass="mGrid" PagerStyle-CssClass="pgr" DataKeyNames="Id" OnRowDataBound="gridLeit_RowDataBound" AllowSorting="True" SortedAscendingHeaderStyle-CssClass="sortasc-header" SortedDescendingHeaderStyle-CssClass="sortdesc-header" OnSorting="gridleitNidurstada_Sorting" CurrentSortField="Id" CurrentSortDir="Ascending" AutoGenerateColumns="False"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" Visible="false"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:HyperLinkField HeaderText="Print" Text="Print" **anything here?**/&gt; &lt;/Columns&gt; &lt;PagerStyle CssClass="pgr"&gt;&lt;/PagerStyle&gt; &lt;SortedAscendingHeaderStyle CssClass="sortasc-header"&gt;&lt;/SortedAscendingHeaderStyle&gt; &lt;SortedDescendingHeaderStyle CssClass="sortdesc-header"&gt;&lt;/SortedDescendingHeaderStyle&gt; &lt;/asp:GridView&gt; </code></pre> <p>Binding is something like this: Could i do it there? Or in the rowbound event?</p> <pre><code>IQueryable&lt;model.SomeClass&gt; someClass = from m in preparePredicate() select new model.SomeClass { Id = m.id, ... }; gridleitNidurstada.DataSource = someClass; gridleitNidurstada.DataBind(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload