[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

ASP.NET DataGrid: how to open a new window with binded data

I have a DataGrid.  Here is the server side:

protected void Page_Load(object sender, EventArgs e)
            if (!IsPostBack)
                PeopleGrid.DataSource = peopleList;
                //PeopleGrid.Columns[1].Visible = false;

and the client side:

    <asp:DataGrid ID="PeopleGrid" runat="server">
                 HeaderText="Select a Person"


I need to:

(1) make all columns invisible except for the first column that is a list of hyperlinks.
(2) if a hyperlink is clicked, open a new window that contains details on the item clicked.  Below is a page that should be displayed:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="PeopleInfo.Details" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <asp:Label ID="Name" runat="server"></asp:Label>
        <asp:Label ID="Address" runat="server"></asp:Label>
        <asp:Label ID="Email" runat="server"></asp:Label>

Thank you.
1 Solution
Easwaran ParamasivamCommented:
You can hide the columns of Grids by setting hiddenfiled as itemtemplate or programatically set column.visible = false. Set the column who has data to be passed as querystring as DataKeynames. Then the ID will be taken even it is hidden.

Please refer below links:



Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now