title: Sort gridView by proper column which is TemplateField
body: <p>I have got problem with sorting column in gridView. I want to select only those rows in column which name equal for example "Finished"</p>
  
  <p>My gridView consists of few BoundField and TamplateFields. When I want to sort by proper BoundField I put proper string to property FilterExpression. For example:</p>
  
  <p>Field in GridView:
  <code>&lt;asp:BoundField DataField="identifier" HeaderText="Case number" SortExpression="identifier" /&gt;</code></p>
  
  <p>so I set
  <code>FilterExpression = "[identifier] LIKE '%" + txtCaseNumber.Text + "%'"</code></p>
  
  <p>where <em>identifier</em> is DataField in BoundField and In this case everything is ok.
  But when I want to select proper rows from column wihich name equal Fininish from TempateField I don't know how I should do it.
  Exaple of TemplateField looks like this:</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Status" SortExpression="Status"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:Label ID="lblStatus" runat="server" Text='&lt;%# Utils.ConvertToProcessStatus((int)Eval("status"))%&gt;'&gt;&lt;/asp:Label&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>If anyone know how I can do it?? </p>
  
  <p>Thanks for help.</p>
  
  <hr>
  
  <p>It's ok but I forgot mention that I have my own user contron (ucCaseFilter) which consists of DropDownList from which I choose status. For example: Failed, InProgress, Finish ...   Inside this control I create public property Filter and I want to assign string value which will be select proper column and sort them .</p>
  
  <pre><code>Filter = "[???] = '" + ddlCaseStatus.SelectedValue + "'"; 
  </code></pre>
  
  <p>Then in gridView use it:</p>
  
  <pre><code>FilterExpression = ucCaseFilter.Filter;
  </code></pre>
  
  <p>I don't know how get column name or other approach which afford me sort by "Status" column.</p>
  
  <p>If I didn't understand previous answerd and it refer to correct soluti</p>