datagridview
-
i am devloping a project mysql query browser in dotnet with c #..... i have a datagridview in my form .. i have to create a table ... there are many columns like col name ,datatype ,not null,primary key and one col is auto increment .....in auto increment i am using checkbox col ....so i want that when user clicks in one rows aut inc col all other row auto inc col should be uncheck like it happens in mysql query browser but it is not happening in my projcet .... please if possible provide the code thanx in advance
-
i am devloping a project mysql query browser in dotnet with c #..... i have a datagridview in my form .. i have to create a table ... there are many columns like col name ,datatype ,not null,primary key and one col is auto increment .....in auto increment i am using checkbox col ....so i want that when user clicks in one rows aut inc col all other row auto inc col should be uncheck like it happens in mysql query browser but it is not happening in my projcet .... please if possible provide the code thanx in advance
Not very clear what you are trying to do and why it has gone wrong. There are plenty of examples of using check boxes in grids - you need to do a porper search on Google. You talk about an auto-increment column: what do you mean by this?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
i am devloping a project mysql query browser in dotnet with c #..... i have a datagridview in my form .. i have to create a table ... there are many columns like col name ,datatype ,not null,primary key and one col is auto increment .....in auto increment i am using checkbox col ....so i want that when user clicks in one rows aut inc col all other row auto inc col should be uncheck like it happens in mysql query browser but it is not happening in my projcet .... please if possible provide the code thanx in advance
Well it looks like from your post that you know you need to supply code for this. Have you written any code to uncheck the other boxes? If so, it would be benifical to see it to help further. Also let us know if you are getting any type of error messages, or what exactly is happening when you click the auto inc column.
-
Not very clear what you are trying to do and why it has gone wrong. There are plenty of examples of using check boxes in grids - you need to do a porper search on Google. You talk about an auto-increment column: what do you mean by this?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
Well it looks like from your post that you know you need to supply code for this. Have you written any code to uncheck the other boxes? If so, it would be benifical to see it to help further. Also let us know if you are getting any type of error messages, or what exactly is happening when you click the auto inc column.
sir this is my code what i am using in my project .... there is a checkbox outside the gridview for checking the inside col cell of gridview and if i chk inside gridview col cell then it checks outside the gridview as it happens in mysql query browser .....thnx in advance
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
q = (string)dataGridView1.CurrentRow.Cells[0].Value;
if (q != null)
{
cntextbox.Text = (string)dataGridView1.CurrentRow.Cells[0].Value;
dttextbox.Text = (string)dataGridView1.CurrentRow.Cells[1].Value;if (Convert.ToBoolean(dataGridView1.CurrentRow.Cells\[4\].Value) == true) checkBox1.Checked = true; else checkBox1.Checked = false; if (Convert.ToBoolean(dataGridView1.CurrentRow.Cells\[2\].Value) == true) checkBox2.Checked = true; else checkBox2.Checked = false; if (Convert.ToBoolean(dataGridView1.CurrentRow.Cells\[3\].Value) == true) { foreach (DataGridViewRow dr in dataGridView1.Rows) { dr.Cells\[3\].Value = false; } checkBox3.Checked = true; } else checkBox3.Checked = false; } } catch (Exception) { } } private void checkBox1\_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) dataGridView1.CurrentRow.Cells\[4\].Value = true; else dataGridView1.CurrentRow.Cells\[4\].Value = false; } private void checkBox2\_CheckedChanged(object sender, EventArgs e) { if (checkBox2.Checked) dataGridView1.CurrentRow.Cells\[2\].Value = true; else dataGridView1.CurrentRow.Cells\[2\].Value = false; } private void dttextbox\_TextChanged(object sender, EventArgs e) { dataGridView1.CurrentRow.Cells\[1\].Value = dttextbox.Text; } private void cntextbox\_TextChanged(obj