title: GridView Sort Expression must return not empty data
body: <p>My program running good. But i try to add up-down icon on my gridView header. but if i make it, My break point should drop below "if comparison" For example; field.SortExpression=Category but every time CustomersGridView.SortExpression is empty when gridview.SortExp is not empty.</p>
  
  <pre><code>foreach (DataControlField field in CustomersGridView.Columns)
      {
        if (field.SortExpression == CustomersGridView.SortExpression)
        {
          return CustomersGridView.Columns.IndexOf(field);
        }
      }
  </code></pre>
  
  <h2> i need :</h2>
  
  <pre><code>
  foreach (DataControlField field in CustomersGridView.Columns)
      {
        if (field.SortExpression == "Category")
        {
          return 2;
        }
      }
  </code></pre>
  
  <p>CustomersGridView.SortExpression must not be empty!!!!!</p>
  
  <h3>MY source:</h3>
  
  <pre><code>&#60;head runat="server"&#62;
      &#60;title&#62;&#60;/title&#62;
       &#60;link type="text/css" href="StyleSheet.css" rel="stylesheet" /&#62;
  &#60;/head&#62;
  &#60;body&#62;
      &#60;form id="form1" runat="server"&#62;
      &#60;div&#62;
          &#60;asp:ScriptManager ID="ScriptManager1" runat="server"&#62;
          &#60;/asp:ScriptManager&#62;
          &#60;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&#62;
          &#60;ContentTemplate&#62;
           &#60;asp:GridView 
                          ID="gvCustomers" runat="server" CssClass="tablestyle" 
                          AllowSorting="true" 
                          OnRowDataBound="GvCustomers_RowDataBound" AutoGenerateColumns="false"&#62;
                          &#60;AlternatingRowStyle CssClass="altrowstyle" /&#62;
                          &#60;HeaderStyle CssClass="headerstyle" /&#62;
                          &#60;RowStyle CssClass="rowstyle" /&#62;
                          &#60;Columns&#62;
                              &#60;asp:BoundField HeaderText="Kategori" DataField="Category" SortExpression="Category" /&#62;
                              &#60;asp:BoundField HeaderText="Tarih" DataField="Date" SortExpression="Date" /&#62;
  
                          &#60;/Columns&#62;
                      &#60;/asp:GridView&#62;
          &#60;/ContentTemplate&#62;
          &#60;/asp:UpdatePanel&#62;</code></pre>
  
  <pre><code>
     protected void GvCustomers_RowDataBound(object sender, GridViewRowEventArgs e)
          {
              GridView gridView = (GridView)sender;
  
              if (gridView.SortExpression.Length > 0)
              {
                  int cellIndex = -1;
                  foreach (DataControlField field in gridView.Columns)
                  {
                      if (field.SortExpression == gvCustomers.SortExpression)
                      {
                          cellIndex = gridView.Columns.IndexOf(field);
                          break;
                      }
                  }
  
                  if (cellIndex > -1)
                  {
                      if (e.Row.RowType == DataControlRowType.Header)
                      {
                          //  this is a header row,
                          //  set the sort style
                          e.Row.Cells[cellIndex].CssClass +=
                              (gridView.SortDirection == SortDirection.Ascending
                              ? " sortascheader" : " sortdescheader");
                      }
                      else if (e.Row.RowType == DataControlRowType.DataRow)
                      {
                          //  this is an alternating row
                          e.Row.Cells[cellIndex].CssClass +=
                              (e.Row.RowIndex % 2 == 0
                              ? " sortaltrow" : " sortrow");
                      }
                  }
              } 
          }
  </code></pre>