如何在特定列中将显示的数据(int)作为GRIDVIEW中的超链接?

时间:2022-05-22 01:07:27

How can I make a DISPLAYED DATA(int) of a PARTICULAR COLUMN to be a hyperlink in a GRIDVIEW, so when I click on that DATA it will display details of that chosen row line items.

如何将特定列的显示数据(int)作为GRIDVIEW中的超链接,因此当我单击该DATA时,它将显示所选行行项目的详细信息。

3 个解决方案

#1


This video does something similiar to that. The details are not inline, but the concept is kind of what you're looking for. There is a grid view, and when clicking on an item, the details view below is populated with the row details. This may give you some ideas. Hope this helps.

这段视频做了类似的事情。细节不是内联的,但这个概念是你正在寻找的。有一个网格视图,当单击某个项目时,下面的详细信息视图将填充行详细信息。这可能会给你一些想法。希望这可以帮助。

http://www.asp.net/learn/3.5-videos/video-363.aspx

#2


I assume that you will give your details at another page, here is a hyperlink column that points to a details page :

我假设您将在另一个页面上提供您的详细信息,这是一个指向详细信息页面的超链接列:

<asp:HyperLinkColumn
    HeaderText="Show Details"
    DataNavigateUrlField="YourIntegerColumn"
    DataNavigateUrlFormatString="detailspage.aspx?id={0}" />

#3


Though I don't think it is what you want, you might want to display details inside of hover text. This should work for you.

虽然我认为这不是您想要的,但您可能希望在悬停文本中显示详细信息。这应该适合你。

<asp:TemplateField HeaderText="Id">
    <ItemTemplate><asp:Label ID="LabelId" runat="server" Text='<%# Eval("Id") %>' ToolTip='<%# Eval("Details") %>' /></ItemTemplate>
</asp:TemplateField>

#1


This video does something similiar to that. The details are not inline, but the concept is kind of what you're looking for. There is a grid view, and when clicking on an item, the details view below is populated with the row details. This may give you some ideas. Hope this helps.

这段视频做了类似的事情。细节不是内联的,但这个概念是你正在寻找的。有一个网格视图,当单击某个项目时,下面的详细信息视图将填充行详细信息。这可能会给你一些想法。希望这可以帮助。

http://www.asp.net/learn/3.5-videos/video-363.aspx

#2


I assume that you will give your details at another page, here is a hyperlink column that points to a details page :

我假设您将在另一个页面上提供您的详细信息,这是一个指向详细信息页面的超链接列:

<asp:HyperLinkColumn
    HeaderText="Show Details"
    DataNavigateUrlField="YourIntegerColumn"
    DataNavigateUrlFormatString="detailspage.aspx?id={0}" />

#3


Though I don't think it is what you want, you might want to display details inside of hover text. This should work for you.

虽然我认为这不是您想要的,但您可能希望在悬停文本中显示详细信息。这应该适合你。

<asp:TemplateField HeaderText="Id">
    <ItemTemplate><asp:Label ID="LabelId" runat="server" Text='<%# Eval("Id") %>' ToolTip='<%# Eval("Details") %>' /></ItemTemplate>
</asp:TemplateField>