title: group by multiple columns (Dynamically) of datatable by linq Query
body: <p>i want to group by multiple columns in a datatable by linq query.</p>
  
  <p>i tried like this,</p>
  
  <pre><code>var _result = from row in tbl.AsEnumerable()
  
  group row by new
  {
      id=row.Field&lt;object&gt;(_strMapColumn),
      value=row.Field&lt;object&gt;(_strValueColumn),
  } into g
  select new
  {
      _strMapColumn = g.Key.id,
      ToolTip = g.Sum(r =&gt; grp.Sum(r =&gt; r.Field&lt;Double&gt;(__strToolTip[1]))),
  };
  </code></pre>
  
  <p>its works fine. my question is i have 10 column names in a strToolTip array i want to access 10 column names dynamically like for loop is it possible?</p>
  
  <p>i want like this</p>
  
  <pre><code>select new
  {_strMapColumn = g.Key.id,
  
     for(int index = 1; index &lt;= 10; index++)
     {    
         ToolTip+index = g.Sum(r =&gt; getDoubleValue(r.Field&lt;Double&gt;(__strToolTip[1])))
     }   
  };
  </code></pre>
  
  <p>and also want to add a DataType Dynamically please kindly provide the answer for solve this.
  linq query is new for me.</p>