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

C# Datagridview

$
0
0

Hi Friends,

how to write" if"" condition  to find number of rows and assign each row ""Column1"" value  to string.

int nos = 0;

nos = dataGridView1.CurrentCell.RowIndex;

  if (nos == 0)
            {
 TxtInput30 = dataGridView1.Rows[0].Cells["Column1"].Value.ToString();
}

if (nos == 1)
            {


               TxtInput30_2 = dataGridView1.Rows[1].Cells["Column1"].Value.ToString();
}

Thanks for your 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>