Firstly, this doesn't appear to have anything to do with a datagrid (based on the code you have provided).
This code does the following:
When the event is trigger it checks to see if text box (tb1) is not equal to an empty string.
It would be better if that line was changed to either:
if(!string.IsNullOrEmpty(this.tb1.Text))
or
if(!string.IsNullOrWhitespace(this.tb1.Text))
(the latter if using .Net 4 or higher.
if this is true, then it looks in the "Users" collection to find the user who's ID matches that of the value in tb1. Then it displays the users name and salary in textboxes 2 and 3 respectively.
It has a lot of potential pitfalls this code, such as no checks to ensure a number was entered in tb1. And no handling if the selected user is not found.
But that answers your question as to what the code does.