hide this column? <asp:TemplateField

enrique_aeo
enrique_aeo used Ask the Experts™
on
I have this grid
 <asp:BoundField DataField="notaFinalCurso" HeaderText="nota"  ItemStyle-CssClass="GridItem" HeaderStyle-CssClass="GridHeader" Visible="true"></asp:BoundField>
                                    <asp:BoundField DataField="notaFinalCursoR" HeaderText="nota Final"  ItemStyle-CssClass="GridItem" HeaderStyle-CssClass="GridHeader" Visible="true"></asp:BoundField>
       <asp:TemplateField  ItemStyle-CssClass="GridItem" HeaderStyle-CssClass="GridHeader">
       <HeaderTemplate>
         <input id="chkBoxAll" type="checkbox" onclick="checkAllBoxes()" /> Pago?
       </HeaderTemplate>
       <ItemTemplate>
           <asp:CheckBox ID="chkBoxChild" runat="server"/>  
       </ItemTemplate>
   </asp:TemplateField>

As I can hide this column? <asp:TemplateField  ... in the code behind
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Have you tried TemplateField.Visible = False

Author

Commented:
I have three columns of type template, as I will indicate what?
Top Expert 2013
Commented:
You can hide entire columns like:
 GridView1.Columns[1].Visible = false; // 1 ~ second column in GV

Or do you want to hide checkbox column for particular rows?

Author

Commented:
I had to hide the column based on a value in the database, your code was enough, thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial