If the total count don't need to be displayed in the row cell, You can achieve your goal easily by using microflow!
First, Make a Non-persistable Entity that store the total count.
Second, Place a Data View widget and set its Data source as Microflow or Nanoflow.
In my example, I chose Microflow.
Third, Set the Data grid 2's Data source as Microflow or Nanoflow and pass the Count object as parameter, use Aggregate function, update the Count object's count attributes, and display it in dataview
Then, walla! The total count of row will be shown in text box when page is opened.
If you need to update when new row is added, just use "refresh in client"