title: ASP.NET GridView bind two field into one column
body: <p>I have ASP.NET GridView in my web app and would like to bind two fields into one column and use string formatting. I am providing example below, is it possible to implement into GridView?</p>
  
  <p>I have two data fields <code>Name</code> and <code>DefaultParam</code> and would like to display these fields into one GridView column. </p>
  
  <p>Like this</p>
  
  <pre><code>Name=DefaultParam
  </code></pre>
  
  <p>If DefaultParam value is empty I would like to show only <code>Name</code> value and do not include <code>=</code></p>
  
  <p>I was using Repeater and code below to achieve this but now decided to move data display to GridView</p>
  
  <pre><code>&lt;%#Eval("Name")%&gt;
  &lt;%# (!string.IsNullOrEmpty(Eval("DefaultParam").ToString())) ? "= " + Eval("DefaultParam"):"" %&gt;
  </code></pre>