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 6009493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:58:42+00:00 2026-05-23T01:58:42+00:00

What I want to do is just display a few specific columns from my

  • 0

What I want to do is just display a few specific columns from my data source on my gridview, but for some reason I’m seeing first the boundfields that I want, followed by every column in the data source.

            <asp:GridView DataSourceId="dsTasks" ID="TasksGridView" runat="server">
                <Columns>
                    <asp:BoundField DataField="field1" HeaderText="field1" />
                    <asp:BoundField DataField="field2" HeaderText="field2" />
                    <asp:BoundField DataField="field3" HeaderText="field3" />
                    <asp:BoundField DataField="field4" HeaderText="field4" />
                    <asp:BoundField DataField="field5" HeaderText="field5" />
                    <asp:BoundField DataField="field6" HeaderText="field6" />
                    <asp:BoundField DataField="field7" HeaderText="field7" />
                </Columns>
            </asp:GridView>

and here is my code for the datasource, just in case thats where it is

<asp:EntityDataSource ID="dsTasks" runat="server" 
            ConnectionString="name=Entities" DefaultContainerName="Entities" 
            EnableFlattening="false" EntitySetName="Tasks" ></asp:EntityDataSource>

Sorry if this is a stupid question…I’m fairly new to .NET in general (try a week)

Also, as a side question, would it be better for me to bind the data this way, or do it in the code-behind on page_load?

  • 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-23T01:58:43+00:00Added an answer on May 23, 2026 at 1:58 am

    Set AutoGenerateColumns to false

    <asp:GridView AutoGenerateColumns="false" DataSourceId="dsTasks" ...
    

    Personally, I prefer binding from markup than from code when and where it’s possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to get the System IP address and display it on a
I want to display html code just like what your see here. <textarea><script id=ff>gdgdgs</script></textarea>
I want to display the posted comment once the user comments. Just to add
Just looking for a good PHP Image Library, I want to display images with
My HTML text is just like this: <p>abcdefghijklmnopqrstuvwxyz</p> What I want is to display
I want just get Image( .JPG , .PNG , .Gif ) File from my
With php file_get_contents() i want just only the post and image. But it's get
In Android 2.2, I want to display a few sprites and clickable animations over
I have a UserControl I've written to display a few properties from a custom
I currently have an ASP.NET GridView that displays a few columns to the user

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.