コード例 #1
0
    //    create proc spdatRELv2_items__for_coderpair
    //(@id varchar(15), @orig_studymeasID int, @rel_studymeasID int, @rel_pkval int, @type int)
    protected void gv_coderpairs_list_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        //  tblmyinfo.Rows[0].Cells[0].InnerHtml += e.CommandSource.ToString();
        //  tblmyinfo.Rows[0].Cells[0].InnerHtml += e.CommandName.ToString() + "<br/>";

        //UpdatePanel UpdatePanel_coderpair_single = (UpdatePanel)FindControl("UpdatePanel_coderpair_single");


        if (e.CommandName == "coderpair_details")
        {
            GridViewRow gvr      = (GridViewRow)((Control)e.CommandSource).NamingContainer;
            int         rowIndex = gvr.RowIndex;

            // The sql_getdetails field is contained in this proc:
            //spRELv2_GET_RelTracking_CoderPairs_by_measure

            if (print_jminfo)
            {
                jminfo.Text += " (btn)gv_coderpairs_list_RowCommand [coderpair_details]..<br/>";
            }

            //Note that the SQL command text is present in the originating datasource:
            string sql_params = e.CommandArgument.ToString();

            ///////////////////////////////
            // Items = 1
            // Scores = 2
            // Text vars = 3

            LoadCoderPairDetails(sql_params);


            //////////////////////////////////////////////////
            //Hide other rows in the main gridview
            int counter = 0;
            foreach (GridViewRow row in gv_coderpairs_list.Rows)
            {
                if (counter == rowIndex)
                {
                    row.Visible = true;
                }
                else
                {
                    row.Visible = false;
                }
                counter++;
            }

            UpdatePanel_coderpair_single.Visible = true;
            UpdatePanel_coderpair_single.Update();
        }
    }
コード例 #2
0
    protected void btnShowAll_Click(object sender, EventArgs e)
    {
        if (print_jminfo)
        {
            jminfo.Text += "btnShowAll_Click..<br/>";
        }
        //////////////////////////////////////////////////
        //Show all rows in the main gridview

        foreach (GridViewRow row in gv_coderpairs_list.Rows)
        {
            row.Visible = true;
        }

        UpdatePanel_coderpairs_list.Update();

        UpdatePanel_coderpair_single.Visible = false;

        UpdatePanel_coderpair_single.Update();
    }
コード例 #3
0
    //    create proc spdatRELv2_items__for_coderpair
    //(@id varchar(15), @orig_studymeasID int, @rel_studymeasID int, @rel_pkval int, @type int)
    protected void gv_coderpairs_list_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "coderpair_details")
        {
            GridViewRow gvr      = (GridViewRow)((Control)e.CommandSource).NamingContainer;
            int         rowIndex = gvr.RowIndex;

            // The sql_getdetails field is contained in this proc:
            //spRELv2_GET_RelTracking_CoderPairs_by_measure

            if (print_jminfo)
            {
                jminfo.Text += " (btn)gv_coderpairs_list_RowCommand [coderpair_details]..<br/>";
            }

            //Note that the SQL command text is present in the originating datasource:
            string sql = e.CommandArgument.ToString();

            ///////////////////////////////
            // Items = 1
            // Scores = 2
            // Text vars = 3


            SqlCommand cmd = new SqlCommand();
            cmd.Connection  = oConnData;
            cmd.CommandType = CommandType.Text;
            DataTable dt = new DataTable();

            for (int i = 1; i < 4; i++)
            {
                string s = sql + ", " + i.ToString();

                cmd.CommandText = s;
                SqlDataReader dr = cmd.ExecuteReader();

                dt.Load(dr);

                GridView gv_coderpair_details = (GridView)UpdatePanel_coderpair_single.ContentTemplateContainer.FindControl("gv_coderpair_details" + i.ToString());
                gv_coderpair_details.DataSource = dt;
                gv_coderpair_details.DataBind();

                //dt.Dispose();
                dt.Clear();
                dr.Close();
            }



            //////////////////////////////////////////////////
            //Hide other rows in the main gridview
            int counter = 0;
            foreach (GridViewRow row in gv_coderpairs_list.Rows)
            {
                if (counter == rowIndex)
                {
                    row.Visible = true;
                }
                else
                {
                    row.Visible = false;
                }
                counter++;
            }

            UpdatePanel_coderpair_single.Visible = true;
            UpdatePanel_coderpair_single.Update();
        }
    }