none
Data Grid properties RRS feed

  • Question

  • Hi I have a grid with my table data. How to identify the selected grid cell using c sharp?

    Please help

    Saturday, April 23, 2011 5:49 AM

Answers

  • Hi,

    To know all selected cells, just use SelectedCells property od DataGridView. To get single selected Cell you can do something as below,

    DataGridViewCell selctedCell = dataGridView1.SelectedCells[0];
    

    Please mark this post as answer if it solved your problem. Happy Programming!

    • Marked as answer by Creative_Pro Sunday, April 24, 2011 2:00 PM
    Saturday, April 23, 2011 6:16 PM

All replies

  • Hi,

    To know all selected cells, just use SelectedCells property od DataGridView. To get single selected Cell you can do something as below,

    DataGridViewCell selctedCell = dataGridView1.SelectedCells[0];
    

    Please mark this post as answer if it solved your problem. Happy Programming!

    • Marked as answer by Creative_Pro Sunday, April 24, 2011 2:00 PM
    Saturday, April 23, 2011 6:16 PM
  • hi Adavesh,

    Thanx for reply. This is very useful for me. Happy coding


    Sunday, April 24, 2011 2:00 PM
  • You are welcome :)

    Please mark this post as answer if it solved your problem. Happy Programming!

    Sunday, April 24, 2011 3:58 PM