Example #1
0
    protected void GridViewUsers_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["UserRoleId"] = GridViewUsers.SelectedRow.Cells[3].Text.Trim();
        foreach (GridViewRow RR in GridViewUsers.Rows)
        {
            RadioButton chhh = (RadioButton)RR.FindControl("C1");
            chhh.Checked = false;
        }
        RadioButton chh = (RadioButton)GridViewUsers.SelectedRow.FindControl("C1");

        chh.Checked = true;

        foreach (GridViewRow R in GvPundles.Rows)
        {
            RadioButton ch = (RadioButton)R.FindControl("C1");

            if (Session["UserRoleId"].ToString() == R.Cells[0].Text.Trim())
            {
                R.BackColor = System.Drawing.Color.Turquoise;
                ch.Checked  = true;
            }
            else
            {
                R.BackColor = System.Drawing.Color.FromArgb(120, 217, 239, 253);;
                ch.Checked  = false;
            }
        }
    }
Example #2
0
 protected void ButtonSellectAll_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow RR in GridViewUsers.Rows)
     {
         RadioButton chh = (RadioButton)RR.FindControl("C1");
         chh.Checked = true;
     }
 }
Example #3
0
    protected void ButtonLink_Click(object sender, EventArgs e)
    {
        //ArrayList al = new ArrayList();
        foreach (GridViewRow R in GvPundles.Rows)
        {
            Session["UserRoleId"] = R.Cells[0].Text.Trim();
            //SqlDataSourceUsers.Delete();
            RadioButton ch = (RadioButton)R.FindControl("C1");

            if (ch.Checked)
            {
                foreach (GridViewRow RR in GridViewUsers.Rows)
                {
                    Session["UserId"] = RR.Cells[0].Text.Trim();
                    RadioButton chh = (RadioButton)RR.FindControl("C1");
                    if (chh.Checked)
                    {
                        SqlDataSourceUsers.Update();
                    }
                }
            }
            LabelErrorMessage.Text = "تم حفظ البيانات";
        }
    }