title: how to format a gridview field to display a rate ex.: 4/5?
body: <p>I have a gridview populated by some text elements.  I am asking the user to put a rate from 1 to 5.  I will like to display the rate in the gridview like this  ex.: if the user select 4 then in the gridview field it will be display as 4/5.  I stored the rate 4 in a database field as a INT.</p>
  
  <p>Here is the code behind</p>
  
  <pre><code>SqlConnection con = new 
      SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings
      ["ConnectionString"].ConnectionString);
  
  //======= Insert Query.
  
  string cmdText = "INSERT INTO Comments VALUES (@comment,@user,@rate, @date)";
  
  SqlCommand cmd = new SqlCommand(cmdText, con);
  
  //===== Adding parameters/Values.
  
  cmd.Parameters.AddWithValue("@comment", txtComment.Text);
  cmd.Parameters.AddWithValue("@user", txtSignature.Text);
  cmd.Parameters.AddWithValue("@rate", lstbxRating.Text);
  cmd.Parameters.AddWithValue("@date", DateTime.Now);
  
  if (con.State == ConnectionState.Closed)
  {
      con.Open();
  }
  int nbrRecords = cmd.ExecuteNonQuery();
  
  con.Close();
  
  if (nbrRecords &gt;= 1)
  {
      GridView1.DataBind();
  }
  }
  </code></pre>
  
  <p>the code .aspx</p>
  
  <pre><code> &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
      DataSourceID="LinqDataSource1"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="comment" HeaderText="comment" ReadOnly="True" 
               SortExpression="comment"  /&gt;
          &lt;asp:BoundField DataField="user" HeaderText="user" ReadOnly="True" 
               SortExpression="usager" /&gt;
          &lt;asp:BoundField DataField="rate" HeaderText="rate" ReadOnly="True" SortExpression="rate"
              /&gt;
          &lt;asp:BoundField DataField="date" HeaderText="date" ReadOnly="True" SortExpression="date" 
              /&gt;
     &lt;/Columns&gt;
   &lt;/asp:GridView&gt;
  </code></pre>