Click here to Skip to main content
16,020,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

my code is :

C#
private void dataGridView1_CellContentClick(object sender,DataGridViewCellEventArgs e)
      {
          Setting_forms fis = new Setting_forms();

          if (e.ColumnIndex == 8)
          {
              fis.Check_codem = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["code_m_Grid"].Value.ToString();
          }
          string us_geid = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["type_zemanat_grid"].Value.ToString();

          if (us_geid == "chek")
          {
              new Show_sub_check().ShowDialog();
          }
          if (us_geid == "safteh")
          {
              new Shosw_sub_safteh().ShowDialog();
          }
          if (us_geid == "tala")
          {
              new Show_sub_tala().ShowDialog();
          }
      }


"e.ColumnIndex == 8 " is linkedlabel in datagridview , when click on that
my form in if-statement is showed , but the last of form in if-statement don't showed.
Posted
Updated 23-Feb-15 17:43pm
v4

1 solution

If you mean that the first two if conditions show a dialog and the third one doesn't, then we can't really help you here: we don;t have access to the rest of your code, so we can't run it.

So start with the debugger: put a breakpoint on the first line in the event handler, and run your app. When it hits the breakpoint, your app will stop, and you can use the debugger to examine exactly what is going on. Hover your mouse over a variable, and it will show the value; you can also single step each instruction to see exactly what is happening where and why.

When you know exactly where the execution is going, you should be able to work it out, but if you can't at least you will be able to tell us! :laugh:
If may be as simple as "string comparisons are case sensitive" so "tala" and "Tala" are not the same, or that "tala" is different to "tala ".
But we can't tell from here!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900