Column sorting not working in GridView

T

Thirsty Traveler

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();
}
 
T

Thirsty Traveler

This is close... however, my GridView.DataSource is returning as null in the
sorting event.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top