views:

31

answers:

1

i click double dataGridView's any row. Not get Data clicked row data:

 
  private void gwStudies_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            GoruntuyuAc();
        }

private void GoruntuyuAc()
        {
            olduid = "";
            DataRowView ro = (gwStudies.SelectedRows[0].DataBoundItem as DataRowView);
            string uid = "";
            uid = ro["StudyInstanceUid"].ToString();
            string tarih = "";
            DateTime t1 = Convert.ToDateTime(ro["StudyDate"]);
            //........
           //............
        }

Error Data on (gwStudies.SelectedRows[0].DataBoundItem as DataRowView);
IMAGE:alt text

A: 

I am not exactly sure, but I think the selection on happens after the double click event.

leppie
How can i solve it?
programmerist
@programmerist: Use the `SelectionChanged` event.
leppie