Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:20:04+00:00 2026-05-23T18:20:04+00:00

I have an ASP Grid View; its Datasource is a list of entities. The

  • 0

I have an ASP Grid View; its Datasource is a list of entities. The entity has 11 properties, but I want to show only some of the columns in the grid view.
My Grid View is

<asp:GridView runat="server" ID="GridForResult"
              Caption="Update The Result for the Folloing Students"
              Visible="true" ShowHeader="false">
  <Columns>
    <asp:TemplateField ItemStyle-Width="100px">
      <ItemTemplate>
        <%#Eval("TestRoll")%>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ItemStyle-Width="120px">
      <ItemTemplate>
        <%#Eval("Name")%>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ItemStyle-Width="80px">
      <ItemTemplate>
        <%#Eval("Program")%>
      </ItemTemplate>
    </asp:TemplateField>
  </Columns>
</asp:GridView>

In my code behind page, I have bound the grid like this:

List<FormGridEntity> gridEntities = new List<FormGridEntity>();
gridEntities = AdmissionResult_BAO.GetAllCandidateAdmissionInfo();
GridForResult.DataSource = gridEntities;
GridForResult.DataBind();
//What Will I need to do here or somewhere else

What should I do now?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:20:05+00:00Added an answer on May 23, 2026 at 6:20 pm

    @V4Vendetta has it right – in your GridView markup, set AutoGenerateColumns=”false”:

    <asp:GridView runat="server" ID="GridForResult" AutoGenerateColumns="false" Caption="Update The Result for the Folloing Students" Visible="true" ShowHeader="false">
    

    Alternatively, if you want to define columns in the markup and turn them off individually, you can set the Visible=”false” property:

    <asp:TemplateField ItemStyle-Width="100px" Visible="false">
    

    You don’t have to do anything in your code-behind, unless you want to turn columns on/off programatically:

    GridForResult.Columns[0].Visible = false; // Turns off the first column
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid view utilizing sql data source. Now I want to delete
I have two Grid View gridview1 and gridview2 inside an asp.net page. In order
I have a fairly simple asp grid view, tied to an object data source.
I have one grid view control in my asp.net web application. For example i
I have this grid view, it has 2 problems. if I sort it by
I have asp:GridView displaying client requests using asp:SqlDataSource . I want to limit displayed
I have an ASP.NET GridView with paging enabled. The list of page indexes are
I have a GridView on my asp page. I want to change the LinqDataSource
I would like to use a grid view that can expand its rows, also
I have a templated Gridview where I only want to display one column (Questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.