Grid view SelectedRowStyle does not apply to Template Fields
<p>Markup</p>

<pre><code>&lt;asp:GridView ID="gridView_Config" runat="server" AutoGenerateColumns="False"
  CssClass="gridViewStyle" OnRowDataBound="gridView_Config_RowDataBound" OnSelectedIndexChanged="gridView_Config_SelectedIndexChanged"&gt;
 &lt;Columns&gt;
  &lt;asp:TemplateField ControlStyle-CssClass="ConfigProfileColumn ProfileTextBoxWidth"&gt;
 &lt;ItemTemplate&gt;
 &lt;div&gt;
 &lt;asp:TextBox Text='&lt;%# Bind("Type") %&gt;' ID="type" runat="server"  ReadOnly="true" CssClass="FieldLabel " &gt;&lt;/asp:TextBox&gt;
&lt;/div&gt;                                                        &lt;/ItemTemplate&gt;                                                      
&lt;/asp:TemplateField&gt;                                                                        &lt;/Columns&gt;
 &lt;SelectedRowStyle CssClass="gridViewSelectedRow" /&gt;
 &lt;HeaderStyle CssClass="gridHeader" /&gt;
&lt;/asp:GridView&gt;
</code></pre>

<p>Code-Behind</p>

<pre><code>protected void gridView_PrintConfig_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    //check the item being bound is actually a DataRow, if it is, 
    //wire up the required html events and attach the relevant JavaScripts 
    if (e.Row.RowType == DataControlRowType.DataRow) 
    { 
        e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gridView_PrintConfig, "Select$" + e.Row.RowIndex); 
    } 
}
</code></pre>

<p>The gridViewSelectedRow css class has background color blue and color as white. but when a row is selected the text color of the template field still remains black instead of white. how do i solve this?</p>
