Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to look for an example for the following logic explained below:

I have gridview which has a column labeled as 'Name', where is displays name parameter's entities. I would like to be able to click on one of the entities (gridview row) and it would redirect me to a web page that holds detailed information on that selected name entity.

Any help would be very much appreciated.
Thank you
Posted
Comments
Richard C Bishop 13-Jan-14 11:37am    
I think you can convert the "Select" command field to a templated field and then change the Select to a link button that redirects you.
miss786 13-Jan-14 11:49am    
Thank you for your quick response. Is their a specific name for this functionality or any little example, to get myself started. Many thanks.

Use grid view template editing as following and then we can pass user id as query string, at the next page u need to get the user id from query string and display details of user with corresponding id

XML
<asp:GridView ID="GridView1" runat="server" DataKeyNames="UserId"
                AutoGenerateColumns="False" 
                CssClass="grid" Width="100%" CellPadding="2">
            <Columns>
                <asp:BoundField DataField="UserId" HeaderText="slno" Visible="False" />
                <asp:TemplateField HeaderText="User Name">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("TaskName") %>' CssClass="grid"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:HyperLinkField  HeaderText="View details"
                    DataNavigateUrlFields="UserId"
                    DataNavigateUrlFormatString="~/Detailspage.aspx?id={0}"
                     DataTextField="view"
                     ItemStyle-Wrap="true" >
<ItemStyle Wrap="True" Width="110px"></ItemStyle>
            </asp:HyperLinkField>

XML
</Columns>
  </asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900