Dynamically setting DataGrid Column Width

When you double click on a column header grid line the column dynamically sets the width of that column so that it shows all of the text of every column. How do I dynamically set the width to the maximum needed width (to show all text within column) without having the user double click the column header grid line?

Loader.
Up arrow icon