Sort Hyperlinks Not Showing Up (ASP.NET 2.0)

Discussion in 'ASP .Net' started by =?Utf-8?B?RG9u?=, Oct 12, 2005.

  1. In my code I'm dynamically creating a GridView control and binding it to a
    DataView object that I create form a DataSet that I get from a web service
    call. It seems that no matter what I do I can not get the sort hyperlinks in
    the header row to show up. I've set AllowSorting to true and various other
    things but no matter what I do I can't get them to show up. Does sorting only
    work with the new SqlDataSource and related objects in ASP.NET 2.0 and not
    data sources like the DataView object.

    Thanks
    =?Utf-8?B?RG9u?=, Oct 12, 2005
    #1
    1. Advertising

  2. Just to help clarify here's a snippet from the problem code:

    protected override void Render(HtmlTextWriter writer)
    {
    DataView dv = new DataView(_ds.Tables[0]);
    _gv = new GridView();
    _gv.AllowSorting = true;
    _gv.DataSource = dv;
    _gv.DataBind();
    _gv.RenderControl(writer);
    }

    When I use this code no matter what properties I seem to set I can not get
    the sort hyperlinks in the header row to show up. If I declaratively create a
    GridView control it works fine. It's only if I dynamically create the control
    as I've done above that I have the problem.

    Ideas?

    "Don" wrote:

    > In my code I'm dynamically creating a GridView control and binding it to a
    > DataView object that I create form a DataSet that I get from a web service
    > call. It seems that no matter what I do I can not get the sort hyperlinks in
    > the header row to show up. I've set AllowSorting to true and various other
    > things but no matter what I do I can't get them to show up. Does sorting only
    > work with the new SqlDataSource and related objects in ASP.NET 2.0 and not
    > data sources like the DataView object.
    >
    > Thanks
    =?Utf-8?B?RG9u?=, Oct 13, 2005
    #2
    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. Jay
    Replies:
    0
    Views:
    481
  2. Brett
    Replies:
    1
    Views:
    481
    Brett
    Sep 9, 2004
  3. Ray Booysen
    Replies:
    2
    Views:
    643
    Ray Booysen
    Mar 28, 2006
  4. Replies:
    1
    Views:
    431
    Winista
    Jul 3, 2006
  5. Navin
    Replies:
    1
    Views:
    684
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page