(ItemGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("OR Name like '{0}%'", searchBox.Text);
Trying search an item in my GridView by using the following line of code from How to search in Data gridview in C# Windows Form application? and got a System.NullReferenceException: 'Object reference not set to an instance of an object.'. Is there anything to solve this?
Very new to c# and need help.