Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Show / Hide GridView Columns using Design Page in ASP.NET ?



VB
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" BorderWidth="1px"
                                              BorderColor="#D2DBE7" CellPadding="2" ForeColor="Black" AllowPaging="true" PageSize="10"
..........
XML
<asp:BoundField DataField="CONTACTNO" HeaderText="Contactno">
                                                     <ItemStyle Width="17%" HorizontalAlign="Center" />
                                                     <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                 </asp:BoundField>
Posted
Comments
Sandeep Mewara 27-Jun-12 5:28am    
Not clear. what do you mean by 'show/hide' using design page?
You want to hide a column in your designer and plan to make it visible later?
shah dipen 27-Jun-12 6:05am    
What exactly you want to do with gridview columns?

you can make columns visible or invisible by setting "Visible" attribute to true or false
 
Share this answer
 
Comments
velmahesh 27-Jun-12 7:09am    
during i set the visible="false" occured the error.
shah dipen 27-Jun-12 7:17am    
can you post which error occurs?
if your using visible false your hidden column value not getting.Use Css to hide the column.
css code is

XML
<style type="text/css" >
    .hidden{
    display:None;
    }
 </style>


add css class in boundfield tag or your hidden column tag
ItemStyle-CssClass="hidden"
 
Share this answer
 
Plz got through this link

Show / Hide GridView Columns in ASP.NET
 
Share this answer
 
i resolved the issues based on removed the columns to stored procedure. and comment the code in design page.. Because, i can't get the proper way...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900