سلام
در گرید یک لینک قرار دادم حالا خواستم با کلیک بر روی لینک یک فرم باز بشه که نام کاربری که روی سطر انتخابی کلیک شد وارد فرم باز شده بشه
کد:
private void FrmBargozariAzmoon_Load(object sender, EventArgs e) {
SqlDataAdapter da2 = new SqlDataAdapter("SelectAllGroup", con);
da2.SelectCommand.CommandType = CommandType.StoredProcedure;
DataTable dt2 = new DataTable();
da2.Fill(dt2);
SqlDataAdapter da = new SqlDataAdapter("SelectUserForExam", con);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
Cmb.DataSource = dt2;
Cmb.DisplayMember = "GroupName";
Cmb.ValueMember = "GroupId";
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex==5)
{
FrmPayam fpayam = new FrmPayam();
fpayam.ShowDialog();
}
}
- - , .
برچسب:
نویسنده: محمد رضا جوادیان