Column sorting not working in GridView

Discussion in 'ASP .Net' started by Thirsty Traveler, May 12, 2006.

  1. I have a web page with a few textboxes used for filtering a read-only result
    set to a GridView. I am unable to get the ObjectDataSource binding to work
    as desired insofar as it returns a resultset on page load prior to the
    filter requests for the query, so I am doing a dynamic binding to the
    returned DataSet after a call to the business logic layer. It seems to work,
    but I am unable to sort on the column headings even though I have set the
    Sort Expression. Is it because of the late binding?

    My code snippet is as follows:

    protected void Search_Click(object sender, ImageClickEventArgs e)
    {
    string conn =
    ConfigurationManager.ConnectionStrings["tst"].ConnectionString;
    TSTBLL bll = new TSTBLL ();
    TSTBE mt = bll.SubmitQuery(tbJobName.Text, tbOrderDateFrom.Text,
    tbOrderDateTo.Text, conn);
    GridView1.DataSource = mt.Test_Table;
    GridView1.DataBind();
    }
    Thirsty Traveler, May 12, 2006
    #1
    1. Advertising

  2. Thirsty Traveler

    K B Guest

    K B, May 14, 2006
    #2
    1. Advertising

  3. Thirsty Traveler, May 15, 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. Replies:
    2
    Views:
    15,825
  2. =?Utf-8?B?TWl0Y2g=?=

    GridView Sorting and paging Not working

    =?Utf-8?B?TWl0Y2g=?=, Jun 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,161
    =?Utf-8?B?TWl0Y2g=?=
    Jun 12, 2006
  3. Keithb
    Replies:
    2
    Views:
    1,116
  4. Keith G Hicks
    Replies:
    3
    Views:
    749
    Keith G Hicks
    Feb 18, 2008
  5. Abraham Luna

    gridview sorting is not working

    Abraham Luna, Aug 29, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    143
    Abraham Luna
    Aug 30, 2005
Loading...

Share This Page