Skip to content
Loading
How to open the POPUP on hyperlink with Grid structure  
  •   
  •   
  •  
  • C#:
    1. using System;  
    2. using System.Collections.Generic;  
    3. using System.Linq;  
    4. using System.Web;  
    5. using System.Web.UI;  
    6. using System.Web.UI.WebControls;  
    7. using System.Data;  
    8. namespace Findcandidates  
    9. {  
    10.     public partial class _default : System.Web.UI.Page  
    11.     {  
    12.         protected void Page_Load(object sender, EventArgs e)  
    13.         {  
    14.             if (!this.IsPostBack)  
    15.             {  
    16.                 DataTable dt = new DataTable();  
    17.                 dt.Columns.AddRange(new DataColumn[7] { new DataColumn("resumetoJDmatch"), new DataColumn("mandatoryskillmatch"), new DataColumn("Datecreated"), new DataColumn("Name"), new DataColumn("phonenumber"), new DataColumn("email"), new DataColumn("Location") });  
    18.                 dt.Rows.Add( "100%","90%""13-may-2019","Suresh Kumar","1234567890","[email protected]""san Jose,CA");  
    19.                 dt.Rows.Add("100%""90%""13-may-2019""Suresh Kumar""1234567890""[email protected]""san Jose,CA");  
    20.                 GridView1.DataSource = dt;  
    21.                 GridView1.DataBind();  
    22.             }  
    23.         }  
    24.         protected void OnRowDataBound(object sender, GridViewRowEventArgs e)  
    25.         {  
    26.             DataTable dt = new DataTable();  
    27.             dt.Columns.AddRange(new DataColumn[7] { new DataColumn("resumetoJDmatch"), new DataColumn("mandatoryskillmatch"), new DataColumn("Datecreated"), new DataColumn("Name"), new DataColumn("phonenumber"), new DataColumn("email"), new DataColumn("Location") });  
    28.             foreach (GridViewRow row in GridView1.Rows)  
    29.             {  
    30.                 if (row.RowType == DataControlRowType.DataRow)  
    31.                 {  
    32.                     CheckBox checkbox = (row.Cells[0].FindControl("checkbox"as CheckBox);  
    33.                     if (checkbox.Checked)  
    34.                     {  
    35.                         string resumetoJDmatch = row.Cells[1].Text;  
    36.                         string mandatoryskillmatch = row.Cells[2].Text;  
    37.                         string Datecreated = row.Cells[3].Text;  
    38.                         string Name = row.Cells[4].Text;  
    39.                         string phonenumber = row.Cells[5].Text;  
    40.                         string email = row.Cells[6].Text;  
    41.                         string Location = row.Cells[7].Text;  
    42.                          
    43.                         dt.Rows.Add(resumetoJDmatch, mandatoryskillmatch, Datecreated, Name, phonenumber, email, Location);  
    44.                     }  
    45.                 }  
    46.             }  
    47.         }  
    48.     }  

    4 Replies

    Know the answer? Post it — somebody with the same question will find it here.