@@ -102,7 +102,9 @@ private void Form1_Load(object sender, EventArgs e)
102102 catch ( Exception exception ) { MessageBox . Show ( exception . Message ) ; }
103103
104104 // focus on last row
105- dataGridView1 . CurrentCell = dataGridView1 . Rows [ dataGridView1 . RowCount - 1 ] . Cells [ 0 ] ;
105+ try { dataGridView1 . CurrentCell = dataGridView1 . Rows [ dataGridView1 . RowCount - 1 ] . Cells [ 0 ] ; } catch { }
106+
107+ label1 . Text = "Total: " + dataGridView1 . RowCount . ToString ( ) + " lines" ;
106108 }
107109
108110 private void deleteCollectionButton_Click ( object sender , EventArgs e )
@@ -170,7 +172,7 @@ private void button7_Click(object sender, EventArgs e)
170172 dataGridView1 . Rows . Add ( false , "......" , "......" , "......" ) ;
171173
172174 // focus on last row
173- dataGridView1 . CurrentCell = dataGridView1 . Rows [ dataGridView1 . RowCount - 1 ] . Cells [ 0 ] ;
175+ try { dataGridView1 . CurrentCell = dataGridView1 . Rows [ dataGridView1 . RowCount - 1 ] . Cells [ 0 ] ; } catch { }
174176 }
175177
176178 private void buttonSelectPathOfFile ( object sender , EventArgs e )
@@ -192,8 +194,6 @@ private void buttonDoReplaceJob_Click(object sender, EventArgs e)
192194 DialogResult result = MessageBox . Show ( "This action will replace all lines with the values specified." , "Confirmation" , MessageBoxButtons . YesNo ) ;
193195 if ( result == DialogResult . Yes )
194196 {
195- label1 . Text = "Attempting new jobs.." ;
196-
197197 foreach ( DataGridViewRow row in dataGridView1 . Rows )
198198 {
199199 // find and replace line from datagridview
0 commit comments