DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

The data source 'ObjectDataSource1' does not support sorting with IEnumerable data

This is a discussion on The data source 'ObjectDataSource1' does not support sorting with IEnumerable data within the .Net Development forums, part of the Programming & Scripting category; my gridview sort order won't work... and i don't understand the error, what is "IEnumerable data"? Code: The data source ...

Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

  #1  
Old June 23rd, 2008, 10:31 AM
Shem's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 292
Rep Power: 2
Shem is on a distinguished road
Default The data source 'ObjectDataSource1' does not support sorting with IEnumerable data

my gridview sort order won't work...
and i don't understand the error, what is "IEnumerable data"?

Code:
 The data source 'ObjectDataSource1' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The data source 'ObjectDataSource1' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: The data source 'ObjectDataSource1' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.]
   System.Web.UI.WebControls.ObjectDataSourceView.CreateEnumerableData(Object dataObject, DataSourceSelectArguments arguments) +1337183
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2822
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +24
   System.Web.UI.Control.PreRenderRecursiveInternal() +86
   System.Web.UI.Control.PreRenderRecursiveInternal() +170
   System.Web.UI.Control.PreRenderRecursiveInternal() +170
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
Shem
Reply With Quote
  #2  
Old June 23rd, 2008, 10:47 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Real name: Jason
Location: Washington, D.C.
Posts: 1,964
Blog Entries: 8
Rep Power: 15
jmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud of
Default

You're using a ListOf your class so you need to create a custom function for handling sorting in GridView.

Here's an example on how to do it: http://www.codeproject.com/useritems...DataSource.asp
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Reply With Quote
  #3  
Old June 23rd, 2008, 10:57 AM
Shem's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 292
Rep Power: 2
Shem is on a distinguished road
Default

Quote:
Originally Posted by jmurrayhead View Post
You're using a ListOf your class so you need to create a custom function for handling sorting in GridView.

Here's an example on how to do it: http://www.codeproject.com/useritems...DataSource.asp
ugh, i've seen that link so many times I still can't make heads or tales on this

Shem
Reply With Quote
  #4  
Old June 23rd, 2008, 11:01 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Real name: Jason
Location: Washington, D.C.
Posts: 1,964
Blog Entries: 8
Rep Power: 15
jmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud of
Default

Quote:
Originally Posted by Shem View Post
ugh, i've seen that link so many times I still can't make heads or tales on this

Shem
Did you download the VB example? I have implemented the same thing. It's not as difficult as it looks. Just try it out and post any problems you have along the way.
Reply With Quote
The Following User Says Thank You to jmurrayhead For This Useful Post:
Shem (June 25th, 2008)
  #5  
Old June 25th, 2008, 03:54 AM
Shem's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 292
Rep Power: 2
Shem is on a distinguished road
Default

another question, can i add more functionality IE links, buttons to
the gridview, or is it better to use the repeater control?
Reply With Quote
  #6  
Old June 25th, 2008, 08:07 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Real name: Jason
Location: Washington, D.C.
Posts: 1,964
Blog Entries: 8
Rep Power: 15
jmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud of
Default

Quote:
Originally Posted by Shem View Post
another question, can i add more functionality IE links, buttons to
the gridview, or is it better to use the repeater control?
Yes, the GridView has a TemplateField column type that you can use to put whatever you want. See here: TemplateField Class (System.Web.UI.WebControls)
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Tags
datasource, gridview, ienumerable, object, sorting

Thread Tools
Display Modes

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 On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Retrieving Web Data using Excel mehere Microsoft Office 13 May 22nd, 2008 03:14 PM
Print out data on a letterhead format Shem .Net Development 3 May 22nd, 2008 09:15 AM
Data Type Mismatch in Criteria Expression alansidman Microsoft Access 1 April 9th, 2008 04:33 PM
Concatenation of Column Data function AOG123 Access Database Samples 0 March 25th, 2008 06:53 AM
Concatenation of Column data function.... Lauramc SQL Code Samples 0 March 17th, 2008 12:32 PM


All times are GMT -4. The time now is 01:45 AM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2