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

Sponsored Links

Discuss "The data source 'ObjectDataSource1' does not support sorting with IEnumerable data" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old June 23rd, 2008, 10:31 AM
Shem's Avatar
Barn Enthusiast

 
Join Date: Mar 2008
Posts: 261
Thanks: 30
Thanked 5 Times in 5 Posts
Rep Power: 1
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
Sponsored Links
  #2  
Old June 23rd, 2008, 10:47 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

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.

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: 261
Thanks: 30
Thanked 5 Times in 5 Posts
Rep Power: 1
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
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

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: 261
Thanks: 30
Thanked 5 Times in 5 Posts
Rep Power: 1
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
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

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
Forum Jump

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 Microsoft Access 0 March 25th, 2008 06:53 AM
[SQL] Concatenation of Column data function.... Lauramc Code Samples 0 March 17th, 2008 12:32 PM


All times are GMT -4. The time now is 05:08 PM.



Content Relevant URLs by vBSEO 3.2.0