Add the functionality for LOF grid

#4959