private void GridSearch()
        {
            lblException.Visible = false;
            string txtSearchValue = txtSearch.Text.ToLower();
            int    length         = txtSearchValue.Length;

            try
            {
                if (length >= 3)
                {
                    DAL = new DataAccessLayer();
                    DataTable dtbl     = DAL.GetSearchRoles(ddlSearch.SelectedValue, txtSearch.Text);
                    int       countrow = dtbl.Rows.Count;
                    if (countrow == 0)
                    {
                        lblSearchError.Visible   = true;
                        lblSearchError.Text      = "No Records Found";
                        lblSearchError.ForeColor = System.Drawing.Color.Red;
                        grdViewRoles.Visible     = false;
                        lblException.Visible     = false;
                    }
                    else
                    {
                        lblSearchError.Visible  = false;
                        grdViewRoles.Visible    = true;
                        grdViewRoles.DataSource = dtbl;
                        grdViewRoles.DataBind();

                        DropDownList                ddl            = grdViewRoles.FooterRow.FindControl("ddlInsertCandidateName") as DropDownList;
                        List <ListItem>             Candidate_Name = new List <ListItem>();
                        Dictionary <string, string> list           = DAL.GetCandidatename();
                        foreach (KeyValuePair <string, string> entry in list)
                        {
                            Candidate_Name.Add(new ListItem(entry.Key, entry.Value.ToString()));
                        }
                        ddl.Items.AddRange(Candidate_Name.ToArray());
                    }
                }
                else
                {
                    lblErrorMessage.Visible  = false;
                    lblSearchError.Visible   = true;
                    lblSearchError.Text      = "Please enter minimum 3 characters";
                    lblSearchError.ForeColor = System.Drawing.Color.Red;
                    lblException.Visible     = false;
                }
            }
            catch (Exception ex)
            {
                lblErrorMessage.Visible = false;
                lblException.Visible    = true;
                lblException.Text       = "Grid Search Exception: " + ex.Message;
                lblException.ForeColor  = System.Drawing.Color.Red;
            }
        }