Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Column sorting not working in GridView

Reply
Thread Tools

Column sorting not working in GridView

 
 
Thirsty Traveler
Guest
Posts: n/a
 
      05-12-2006
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();
}


 
Reply With Quote
 
 
 
 
K B
Guest
Posts: n/a
 
      05-14-2006
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 ***
 
Reply With Quote
 
 
 
 
Thirsty Traveler
Guest
Posts: n/a
 
      05-15-2006
This is close... however, my GridView.DataSource is returning as null in the
sorting event.

"K B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ***



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
How to hide a GridView column when the column's Visible property does not support databinding? Keithb ASP .Net 2 10-27-2006 05:02 AM
Gridview control and sorting a calculated templatefield column ? markm75c@msn.com ASP .Net 2 06-14-2006 01:49 AM
GridView Sorting and paging Not working =?Utf-8?B?TWl0Y2g=?= ASP .Net 0 06-12-2006 09:00 PM
gridview sorting is not working Abraham Luna ASP .Net Datagrid Control 2 08-30-2005 12:34 PM



Advertisments