Esempio n. 1
0
 protected void DeleteRecord()
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         StrelbaDTO strelba = dataGridView1.SelectedRows[0].DataBoundItem as StrelbaDTO;
         Strelba.delete(Strelba.getById(strelba.Id));
         GetData();
     }
 }
Esempio n. 2
0
 private Strelba GetSelectedStr()
 {
     // The "SelectionMode" property of the data grid view must be set to "FullRowSelect".
     if (dataGridView1.SelectedRows.Count == 1)
     {
         StrelbaDTO strelba = dataGridView1.SelectedRows[0].DataBoundItem as StrelbaDTO;
         return(Strelba.getById(strelba.Id));
     }
     else
     {
         return(null);
     }
 }