public bool IsTheLastItem(object item) { bool result = false; UserDetailModel userItem = item as UserDetailModel; if (userItem != null) { result = ListOfEmployees.IndexOf(userItem) == ListOfEmployees.Count - 1; } return(result); }