Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:17:19+00:00 2026-05-23T00:17:19+00:00

I have project on recruitment.In this project, at one form I have a grid

  • 0

I have project on recruitment.In this project, at one form I have a grid view which contains details of all vacancies. Along with this there is button. When user clicks on this button, available interview schedule for that particular vacancy will be visible in another grid below that row. What I did is I have placed grid view inside table and table is initially invisible. When user clicks on the image button, at that time I tried to find table from the grid view but it can not be found.
Here is the code of my .aspx page

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<table class="formtTbl" width="100%">
    <tr>
        <td width="10%">
            &nbsp;
        </td>
        <td>
            &nbsp;</td>
        <td width="10%">
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td align="center" class="tdtitle">
            Open vacancies
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
        <asp:ImageButton ID="addVacancyBtn" runat="server" 
            ImageUrl="~/Resources/add.png" onclick="addVacancyBtn_Click" />
            &nbsp;
            Add New Vacancy</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            <asp:GridView ID="VacancyGrid" runat="server" CssClass="mGrid" 
                AutoGenerateColumns="False" onrowcommand="VacancyGrid_RowCommand">
                <AlternatingRowStyle CssClass="alt" />
                <Columns>
                 <asp:TemplateField>
                     <ItemTemplate>
                        <asp:ImageButton ID="ScheduleBtn" runat="server" 
                         ImageUrl="~/Resources/01.gif"  
                         ToolTip="View Interview Schedule" Width="20px"
                         CommandName="View Schedule" CommandArgument="<%#((GridViewRow)Container).RowIndex %>"/>
                     </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="VacId" DataField="VacId" />
                    <asp:BoundField HeaderText="Title" DataField="VacTitle" />
                    <asp:BoundField HeaderText="Open" DataField="TotalOpening" />
                    <asp:BoundField HeaderText="Criteria" DataField="criteria" />
                    <asp:BoundField HeaderText="Key Skills" DataField="KeySkills" />
                    <asp:BoundField HeaderText="Exp" DataField="RequiredExperience" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="editBtn" runat="server" 
                                ImageUrl="~/Resources/art-knife.png" Width="20px" 
                                CommandName="Edit" CommandArgument="<%#((GridViewRow)Container).RowIndex %>"/>
                        </ItemTemplate>
                        <EditItemTemplate>
                            Edit
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="statusLbl" runat="server" Text="Label"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                        <table id="ScheduleTable" visible="false">
                        <tr id="abc" visible="false"> 
                          <td colspan="10">
                            <asp:GridView ID="scheduleGrid" runat="server" Visible="False" 
                                  AutoGenerateColumns="False" onrowcommand="scheduleGrid_RowCommand">
                            <Columns>
                            <asp:BoundField DataField="VacId" HeaderText="ID" />
                           <asp:BoundField DataField="VacTitle" HeaderText="Title" />
                            <asp:BoundField DataField="InterviewTime" HeaderText="Interview Date & Time" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="viewIntervieweesBtn" runat="server" 
                                            ImageUrl="~/Resources/document.png" ToolTip="View interiviewees" Width="20px" 
                                            CommandName="View Interviewees" CommandArgument="<%#((GridViewRow)Container).RowIndex %>"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            </asp:GridView>
                            <asp:Label ID="ScheduleNotifyLbl" runat="server" Visible="false"></asp:Label>
                           </td>
                        </tr>
                        </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerStyle CssClass="pgr" />
            </asp:GridView>
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td align="left">
            <asp:Label ID="notificationLbl" runat="server" Font-Size="X-Large" 
                ForeColor="Red" Text="Label" Visible="False"></asp:Label>
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    </table>
</asp:Content>

//Here is the code for my .aspx.cs page

public partial class Department_VacancyList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
    DataTable VacancyTable = null;
    try
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["status"] != null)
            {
                // strStatus = Request.QueryString["status"];
                Session.Add("strStatus", Request.QueryString["status"]);
            }
            if (Session["OpResult"] != null)
            {
                notificationLbl.Visible = true;
                if (Session["OpResult"].ToString() == "InsertSuceess")
                    notificationLbl.Text = "New Vacancy Has Been Created Successfully";
                if (Session["OpResult"].ToString() == "InsertFail")
                    notificationLbl.Text = "An Error Occured While Creating New Vacancy..";
                if (Session["OpResult"].ToString() == "EditSuccess")
                    notificationLbl.Text = "Your Changes Has Been Saved Successfully";
                if (Session["OpResult"].ToString() == "EditFail")
                    notificationLbl.Text = "An Error Occured While Saving Changes...";
            }
            using (VacancyMasterClass VacMaster = new VacancyMasterClass())
            {
                if (Session["strStatus"].ToString() == "1")//All Vacancies
                    VacancyTable = VacMaster.getTable("and DeptId=1 and CompId=1");//Change Here.
                else if (Session["strStatus"].ToString() == "2")//Open Vacancies
                    VacancyTable = VacMaster.getTable("and DeptId=1 and CompId=1 and Status=0");//Change Here.
                else if (Session["strStatus"].ToString() == "3")//Closed Vacancies
                    VacancyTable = VacMaster.getTable("and DeptId=1 and CompId=1 and Status=1");//Change Here.
                VacancyGrid.DataSource = VacancyTable;
                VacancyGrid.DataBind();
                VacancyGrid.ControlStyle.Width = 650;
                VacancyGrid.Columns[0].ItemStyle.Width = 20;
                VacancyGrid.Columns[1].ItemStyle.Width = 10;
                VacancyGrid.Columns[2].ItemStyle.Width = 150;
                VacancyGrid.Columns[3].ItemStyle.Width = 20;
                VacancyGrid.Columns[4].ItemStyle.Width = 190;
                VacancyGrid.Columns[5].ItemStyle.Width = 190;
                VacancyGrid.Columns[6].ItemStyle.Width = 20;
                VacancyGrid.Columns[7].ItemStyle.Width = 30;
                VacancyGrid.Columns[8].ItemStyle.Width = 30;
                VacancyGrid.Columns[9].ItemStyle.Width = 0;
                VacancyGrid.Columns[1].Visible = false;
                if (Session["strStatus"].ToString() == "1" || Session["strStatus"].ToString() == "3")
                {
                    VacancyGrid.Columns[7].Visible = false;
                    VacancyGrid.Columns[0].Visible = false;
                    for (int intRowcount = 0; intRowcount < VacancyTable.Rows.Count; intRowcount++)
                    {
                        Label StatusLbl = (Label)VacancyGrid.Rows[intRowcount].Cells[6].FindControl("statusLbl");
                        if (VacancyTable.Rows[intRowcount]["Status"].ToString() == "False")
                        {
                            StatusLbl.ForeColor = Color.Green;
                            StatusLbl.Text = "Open";
                        }
                        else
                        {
                            StatusLbl.ForeColor = Color.Red;
                            StatusLbl.Text = "Closed";
                        }
                    }
                }
                else if (Session["strStatus"].ToString() == "2")
                    VacancyGrid.Columns[8].Visible = false;
            }      
        }
    }
    catch (Exception ex)
    {
        CommonProcedures.WriteErrorLog("Department_VacancyList", "Page_Load", ex.Message);
    }
    finally
    {
        Session.Remove("OpResult");
    }
}
//protected void VacancyGrid_RowEditing(object sender, GridViewEditEventArgs e)
//{
//    int intOpMode = 2;//Edit Mode
//    int intVacId = Convert.ToInt32(VacancyGrid.Rows[e.NewEditIndex].Cells[1].Text);
//    Response.Redirect("create_vacancyfrm.aspx?VacId="+intVacId+"&OpMode="+intOpMode);
//}
protected void addVacancyBtn_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
    int intOpMode = 1;//Edit Mode
    int intVacId = 0;
    Response.Redirect("create_vacancyfrm.aspx?DeptId=1&CompId=1&VacId=" + intVacId + "&OpMode=" + intOpMode);//Change Here
}
protected void VacancyGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
    DataTable InterviewScheduleTable = null;
    int intVacid = 0;
    try
    {
        if (e.CommandName == "View Schedule")
        {

            int intRowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow Row = VacancyGrid.Rows[intRowIndex];
            //Table ScheduleTable = (Table)Row.FindControl("ScheduleTable");
            intVacid = Convert.ToInt32(Row.Cells[1].Text);
            GridView scheduleGrid = (GridView)Row.FindControl("scheduleGrid");
            Label ScheduleNotifyLbl = (Label)Row.FindControl("ScheduleNotifyLbl");

            if (scheduleGrid.Visible == false)
            {
                using (vwVacInterviewShcedule oInterviewSchedule = new vwVacInterviewShcedule())
                {
                    InterviewScheduleTable = oInterviewSchedule.getTable("and VacId=" + intVacid);
                    if (InterviewScheduleTable.Rows.Count > 0)
                    {
                        scheduleGrid.Visible = true;
                        scheduleGrid.DataSource = InterviewScheduleTable;
                        scheduleGrid.DataBind();
                        scheduleGrid.ControlStyle.Width = 650;
                        scheduleGrid.Columns[0].ItemStyle.Width = 10;
                        scheduleGrid.Columns[1].ItemStyle.Width = 300;
                        scheduleGrid.Columns[2].ItemStyle.Width = 250;
                        scheduleGrid.Columns[3].ItemStyle.Width = 90;
                    }
                    else
                    {
                        if (ScheduleNotifyLbl.Visible == false)
                        {
                            ScheduleNotifyLbl.Visible = true;
                            ScheduleNotifyLbl.Text = "Interview is yet to schedyule for this vacancy";
                        }
                        else
                        {
                            ScheduleNotifyLbl.Visible = false;
                        }
                    }
                }
            }
            else
            {
                scheduleGrid.Visible = false;
            }

        }
        ViewState.Add("VacId", intVacid);
        if (e.CommandName == "Edit")
        {
            int intOpMode = 2;
            int intRowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow Row = VacancyGrid.Rows[intRowIndex];
            int intVacId = Convert.ToInt32(Row.Cells[1].Text);
            Response.Redirect("create_vacancyfrm.aspx?VacId=" + intVacId + "&OpMode=" + intOpMode);
        }
    }
    catch (Exception ex)
    {
        CommonProcedures.WriteErrorLog("Department_VacancyList", "VacancyGrid_RowCommand", ex.Message);
    }
    finally
    {
        InterviewScheduleTable = null;
    }
}

 protected void scheduleGrid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
    try
    {
        foreach (GridViewRow Row in VacancyGrid.Rows)
        {
            GridView ScheduleGrid = (GridView)Row.FindControl("scheduleGrid");
            if (e.CommandName == "View Interviewees")
            {
                int intRowIndex = Convert.ToInt32(e.CommandArgument);
                GridViewRow ScheduleGridRow = ScheduleGrid.Rows[intRowIndex];
                int intVacId = Convert.ToInt32(ScheduleGridRow.Cells[3].Text);
                Session.Add("Time",ScheduleGridRow.Cells[2].Text);
                Response.Redirect("~/Department Head/Schedulefrm.aspx?VacId="+intVacId);
            }
        }
    }
    catch (Exception ex)
    {
        CommonProcedures.WriteErrorLog("Department_VacancyList", "scheduleGrid_RowCommand", ex.Message);
      }
   }
}

Please show me my problem…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:17:20+00:00Added an answer on May 23, 2026 at 12:17 am

    You have provided too much code, that can’t be read easily. You have to narrow it down to a specific point.

    Let me try to help you on your specific problem.

    If you set the control visible=false it will not render at client side and you can’t make that control visible later on in client side. Have a look at this similar thread to get an idea how to proceed: Want to make the visibility true from client side of the control which made invisible from server side

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have project which uses gcc and make files. Project also contains of one
I have project, this contains header files like. #import Three20/TTButton.h #import Three20/TTStyle.h #import Three20/TTStyleSheet.h
I have project named FSharpProject in whick there is code like this: module FSharpProject.ViewModel
I have project which includes external jar file in it, I followed this link
I'm writing a tasklist and have Project object, which holds all the tasks (and
I have project in Dropbox and two running laptops: one with Ubuntu and one
folks! I have project in cc.net and this project nay start by 3 ways
I have project at asp.net mvc. And there is problem i dont know how
I have project which contain 4 tables among these shedule table Session column i
Suppose I have Project X under closed source. It references/links to component Y which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.