Improved datagrid select code. Updated datagrid test cases.