move your method to Utility
calls and make it as static
public class Utility
{
public static DataTable LINQToDataTable<T>(IEnumerable<T> varlist)
{
// code ....
}
}
now you can call it as :
DataTable gridTable = Utility.LINQToDataTable(GetGrids);