HI
My need is
i have a radcheckbox and rad grid.while selecting or ticking the checkbox it will select whole row and after i press update button that row should be updated .How can I do This?Can anyone Help Me?
I have to do this in C#
My code is this
for (int i = 0; i < DeleteGridView1.Rows.Count;i++)
{
String cguid = DeleteGridView1.Rows[i].Cells[1].Value.ToString();
SqlCommand cmd = new SqlCommand();
Program.StrSql = "update QbCompany set ActiveFlag = 0 Where CompanyGUID='"+ cguid + "'";
cmd.Connection = Program.QbSysDbCon;
cmd.CommandText = Program.StrSql;
cmd.ExecuteNonQuery();
}

Vivek JoyPosted Sep 3, 2015, 8:07 AM
Raja TPosted Sep 3, 2015, 4:56 AM
{
SysConfig QbSysConfig = new SysConfig();
String StrCompanyGuid = QbSysConfig.ToString();
for (int i = 0; i < DeleteGridView1.Rows.Count;i++)
{
String a = DeleteGridView1.Rows[i].Cells[0].Value.ToString();
String cguid = DeleteGridView1.Rows[i].Cells[1].Value.ToString();
SqlCommand cmd = new SqlCommand();
Program.StrSql = "update QbCompany set ActiveFlag = 0 Where ' '='"+ a + "'";
cmd.Connection = Program.QbSysDbCon;
cmd.CommandText = Program.StrSql;
cmd.ExecuteNonQuery();
}
MessageBox.Show("Deleted");
} }
Vivek JoyPosted Sep 3, 2015, 4:52 AM
Vivek JoyPosted Sep 3, 2015, 12:30 AM
Raja TPosted Sep 1, 2015, 11:15 AM
private void Delete_Click(object sender, EventArgs e)
{
SysConfig QbSysConfig = new SysConfig();
String StrCompanyGuid = QbSysConfig.ToString();
for (int i = 0; i < DeleteGridView1.Rows.Count;i++)
{
String a = DeleteGridView1.Rows[i].Cells[0].Value.ToString();
String cguid = DeleteGridView1.Rows[i].Cells[1].Value.ToString();
SqlCommand cmd = new SqlCommand();
Program.StrSql = "update QbCompany set ActiveFlag = 0 Where ' '='"+ a + "'";
cmd.Connection = Program.QbSysDbCon;
cmd.CommandText = Program.StrSql;
cmd.ExecuteNonQuery();
}
MessageBox.Show("Deleted");
} }
As per my understanding of ur requirement is in grid view contains check box. When click check box enable delete button and delete record in a table?
Or
When you click on check selected row I'd based update activeflag=1 ?
Please check and confirm which scenario u need?
Vivek JoyPosted Sep 1, 2015, 8:58 AM
Raja TPosted Sep 1, 2015, 8:50 AM
Raja TPosted Sep 1, 2015, 8:48 AM
Vivek JoyPosted Sep 1, 2015, 8:42 AM
Raja TPosted Sep 1, 2015, 8:12 AM
Vivek JoyPosted Sep 1, 2015, 8:09 AM
Raja TPosted Sep 1, 2015, 8:00 AM
Vivek JoyPosted Sep 1, 2015, 7:46 AM
Raja TPosted Sep 1, 2015, 7:15 AM