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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:40:08+00:00 2026-06-11T04:40:08+00:00

I have a Gridview that I bind to an ObjectDataSoure. The ObjectDataSource uses a

  • 0

I have a Gridview that I bind to an ObjectDataSoure.

The ObjectDataSource uses a business object that calls a DAL method that returns DataTable with the query results.

Application works at run time ,But at design time there is a problem:
When I use the GridView’s Tasks Wizard -> Edit Columns : No fields appear in the Selected fields text area(So I can’t use the wizard to edit the columns).

DAL methods:

public override DataTable GetAllWorkers()
    {
        using (SqlConnection con = new SqlConnection(this.ConnectionString)) {
            SqlCommand cmd = new SqlCommand("t_Workers_GetAllWorkers", con);
            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            return GetTable(cmd);
        } 

    }

    private DataTable GetTable(SqlCommand cmd)
    {

        SqlDataAdapter adp = new SqlDataAdapter();
        adp.SelectCommand = cmd;
        DataTable dt = new DataTable();
        adp.Fill(dt);
        return dt;

    }

BLL Method :

public static DataTable GetAllWorkers()
    {
        return DataProvider.Instance().GetAllWorkers();
    }

ASPX web page :

       <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetAllWorkers" TypeName="BLL.BizImpl"></asp:ObjectDataSource>

    <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" 
        EnableModelValidation="True" Height="156px" Width="270px">
    </asp:GridView>

Can someone please explain what is the cause for the problem ?

   Thanks
  • 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-06-11T04:40:10+00:00Added an answer on June 11, 2026 at 4:40 am

    It seems that because you do not specifically declare your columns in your aspx Page you won’t be able to see them in Wizard. At the moment your GridView is populated with data because the

    AutoGenerateColumns
    

    property defaults to true. You can turn the to false and define the columns yourself. You then have more control over what you want to display in them etc.

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

Sidebar

Related Questions

I have a GridView to which I bind a dataTable that I manually created.
I have a gridview that is bind to the datatable. how to programmaticaly change
I have a gridview that I bind with the result of a linq query
I have a GridView that I would like to bind to an ObjectDataSource. I
I have html that is dynamically created when I bind my gridview to a
Background I have a GridView that builds a table using an ObjectDataSource . This
We have a GridView that bind to some data and it look like this:
I have a gridview that binds its rows from an objects method: public DataSet
I have an ASP.NET GridView that uses an EmptyDataTemplate. This template is used to
I have a GridView on an ASP.NET page that I'm trying to bind to

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.