Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Column sorting not working in GridView (http://www.velocityreviews.com/forums/t292097-column-sorting-not-working-in-gridview.html)

Thirsty Traveler 05-12-2006 08:02 PM

Column sorting not working in GridView
 
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();
}



K B 05-14-2006 03:03 AM

Re: Column sorting not working in GridView
 
Oops...gave u the wrong link. This is the link with ALL the
information...

http://www.learnasp.com/freebook/lea...oDataSourceCon
trol.aspx


HTH,
Kit


*** Sent via Developersdex http://www.developersdex.com ***

Thirsty Traveler 05-15-2006 06:59 PM

Re: Column sorting not working in GridView
 
This is close... however, my GridView.DataSource is returning as null in the
sorting event.

"K B" <kathyburke40@comcast.net> wrote in message
news:OOhexLwdGHA.2188@TK2MSFTNGP05.phx.gbl...
> Oops...gave u the wrong link. This is the link with ALL the
> information...
>
> http://www.learnasp.com/freebook/lea...oDataSourceCon
> trol.aspx
>
>
> HTH,
> Kit
>
>
> *** Sent via Developersdex http://www.developersdex.com ***





All times are GMT. The time now is 12:17 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.