Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

how to match values of two columns on databindingcomplete event. and if all the records of both the columns match disable gridview

$
0
0

Please help me

i have a code for this but this can be done only on cell content click

 if (e.ColumnIndex == 4)
            {
                if (Double.Parse(dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString()) == Double.Parse(dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString()))
                {
                    MessageBox.Show("Records matched");

                    dataGridView1.CurrentRow.ReadOnly = true;
                    dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.LightGray;

                }
                else
                {
                    MessageBox.Show("Records does not match");
                }
            }

this code is perfect but it cant be fired on databindingcomplete. Pls help


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>