Problem with GridView

Discussion in 'ASP .Net' started by Loading name..., Aug 29, 2006.

  1. Hey

    asp.net 2.0

    I have a GridView on my webpage. This GridView's datasource is a
    SqlDataSource. The SqlDataSource returns 3 columns.

    Here is my problem:
    My GridView consist of 3 columns (id column + 2 text columns). I want to
    hide the id column, and change the formating of the text columns. I've tryed
    using "Edit Columns". But my BoundFields don't appear in the "Selected
    Field"-section. Adding them to the "Selected Field"-selection causes each of
    this columns to appear twice in the GridView.

    I also tryed to do the column formating directly in the html source, but
    there I don't see these columns at all. This is the only column I see:
    <columns>
    <asp:CommandField ShowSelectionButton="True" />
    </columns>

    Any suggestions on how I should fix this problem?
     
    Loading name..., Aug 29, 2006
    #1
    1. Advertising

  2. I've solved the problem by deleting the GridView and its SqlDataSource, and
    then add a new GridView onto the webpage. However, it would be interesting
    to know what I did wrong with my first GridView?


    "Loading name..." <it_consultant1@NO_SPAM.hotmail.com> wrote in message
    news:...
    > Hey
    >
    > asp.net 2.0
    >
    > I have a GridView on my webpage. This GridView's datasource is a
    > SqlDataSource. The SqlDataSource returns 3 columns.
    >
    > Here is my problem:
    > My GridView consist of 3 columns (id column + 2 text columns). I want to
    > hide the id column, and change the formating of the text columns. I've
    > tryed using "Edit Columns". But my BoundFields don't appear in the
    > "Selected Field"-section. Adding them to the "Selected Field"-selection
    > causes each of this columns to appear twice in the GridView.
    >
    > I also tryed to do the column formating directly in the html source, but
    > there I don't see these columns at all. This is the only column I see:
    > <columns>
    > <asp:CommandField ShowSelectionButton="True" />
    > </columns>
    >
    > Any suggestions on how I should fix this problem?
    >
     
    Loading name..., Aug 29, 2006
    #2
    1. Advertising

  3. Loading name...

    Jim Andersen Guest

    Loading name... wrote:
    > I've solved the problem by deleting the GridView and its
    > SqlDataSource, and then add a new GridView onto the webpage. However,
    > it would be interesting to know what I did wrong with my first
    > GridView?


    Maybe you checked the "autogenerate columns" ?

    /jim
     
    Jim Andersen, Aug 29, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nalaka

    GridView in a GridView

    Nalaka, Nov 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    6,653
    Nalaka
    Dec 5, 2005
  2. Replies:
    3
    Views:
    5,141
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,038
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. Vik
    Replies:
    1
    Views:
    541
  5. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    937
    HeavyMetal
    Aug 8, 2006
Loading...

Share This Page