What you are talking about is actually the RegionUpdater.
For the adminhtml, you can find it in this file : (look for RegionUpdater, I have it on line 185)
You can use it on your grid by adding a select element to your grid, and calling the RegionUpdater class with the good id of the elements. (You will need the country select element, the state text element, the state select element, as well as the data of the regions)
You can find an example of how it is used in the backend in this file : (the function render will interest you)