Hide asp.net GridView row with condition
<p>This is my grid </p>

<pre><code>  &lt;asp:GridView ID="gridProduct"  runat="server" 
    AutoGenerateColumns="false"  
    ShowFooter="true" 
    onrowcancelingedit="gridProduct_RowCancelingEdit" 
    onrowdeleting="gridProduct_RowDeleting" onrowediting="gridProduct_RowEditing" 
    onrowupdating="gridProduct_RowUpdating" 
    onrowcommand="gridProduct_RowCommand"
    onrowdatabound="gridProduct_RowDataBound"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:Button ID="buttonUpdate" CommandName="Update" runat="server" ToolTip="Update" Text="Update" /&gt;
                &lt;asp:Button ID="buttonCancel" CommandName="Cancel" runat="server" ToolTip="Cancel" Text="Cancel" /&gt;
            &lt;/EditItemTemplate&gt;

            &lt;ItemTemplate&gt;
                &lt;asp:Button ID="buttonEdit" CommandName="Edit" runat="server" Text="Edit" ToolTip="Edit"/&gt;
                &lt;asp:Button ID="buttonDelete" CommandName="Delete" runat="server" Text="Delete" ToolTip="Delete"/&gt;
            &lt;/ItemTemplate&gt;
            &lt;FooterTemplate&gt;
                &lt;asp:Button ID="buttonAdd" runat="server" Text="Ajouter" CommandName="AddNew" ToolTip="Add new User" ValidationGroup="validaiton" /&gt;
            &lt;/FooterTemplate&gt;

            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="#Piece"&gt;
            &lt;EditItemTemplate&gt;
            &lt;asp:Label ID="labelEditPiece" runat="server" Text='&lt;%#Eval("Piece") %&gt;'/&gt;
            &lt;/EditItemTemplate&gt;
            &lt;ItemTemplate&gt;
            &lt;asp:Label ID="labelItemPiece" runat="server" Text='&lt;%#Eval("Piece") %&gt;'/&gt;
            &lt;/ItemTemplate&gt;
            &lt;FooterTemplate&gt;
            &lt;asp:DropDownList ID="dropDownListPartsFooter" runat="server" DataTextField="Nom" DataValueField="ID_AchatTemplate"&gt;
            &lt;/asp:DropDownList&gt;   

             ControlToValidate="txtBoxPiece" Text="*" ValidationGroup="validaiton"/&gt;--%&gt;
            &lt;/FooterTemplate&gt; 

             &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="Series"&gt;
            &lt;EditItemTemplate&gt;
            &lt;asp:Label ID="labelEditSeries" runat="server" Text='&lt;%#Eval("Series") %&gt;'/&gt;
            &lt;/EditItemTemplate&gt;
            &lt;ItemTemplate&gt;
            &lt;asp:Label ID="labelItemSeries" runat="server" Text='&lt;%#Eval("Series") %&gt;'/&gt;

            &lt;/ItemTemplate&gt;
            &lt;FooterTemplate&gt;
            &lt;asp:TextBox ID="txtBoxSeries" runat="server"/&gt;
            &lt;asp:RequiredFieldValidator ID="fieldValidSeries" runat="server" ControlToValidate="txtBoxSeries" Text="*" ValidationGroup="validaiton"/&gt;
            &lt;/FooterTemplate&gt; 

              .... &lt;/asp:TemplateField&gt; 

           &lt;/Columns&gt; 
</code></pre>

<p>This is my page load </p>

<pre><code>        protected void Page_Load(object sender, EventArgs e)
{

    if (!IsPostBack)
    {
        PsaDataSet psaList = new PsaDataSet();
        ViewState.Remove("psaList");
        ViewState.Add("psaList", psaList);
        ViewState.Add("psaUid", Guid.NewGuid());

        if (psaList.PsaLink.DefaultView.Count == 0)
             {

                // Patch for view  footer row when no data
                PsaDataSet.PsaLinkDataTable tmpList = new           PsaDataSet.PsaLinkDataTable();

                PsaDataSet.PsaLinkRow tmpItem = tmpList.NewPsaLinkRow();
                tmpItem.PsaUid = (Guid)ViewState["psaUid"];
                tmpItem.PsaProductUid = Guid.Empty;
                tmpItem.ProductId = 1;
                tmpItem.Series = "test";
                tmpItem.Rev = "test";
                tmpItem.Firmware = "test";
                tmpList.AddPsaLinkRow(tmpItem);
                tmpList.AcceptChanges();
                ViewState.Add("series", tmpItem.Series);


                gridProduct.DataSource = tmpList;
                gridProduct.DataBind();


            }

    }
    else
    {
        //BindGrid((PsaDataSet)ViewState["psaList"], false);

    }
}

private void BindGrid(PsaDataSet psaList, bool mustDataBind)
{

    gridProduct.DataSource = psaList.PsaLink;


    //if (mustDataBind)
    //{
        gridProduct.DataBind();
    //}
} 
</code></pre>

<p>This my onrowdatabound="gridProduct_RowDataBound"> method</p>

<pre><code>     protected void gridProduct_RowDataBound(object sender, GridViewRowEventArgs e)
    {
         if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes["style"] = "display:none";

            }
        }
 }
</code></pre>

<p>I want to add a condition (Based whit a test value inserted in page load)  in the if(protected void gridProduct_RowDataBound method) for hiding just one time on page load??</p>

<p>Thank Frank!</p>
