Fixed DataGrid processing function