+ Reply to Thread
Results 1 to 6 of 6

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

  1. #1
    Barn Enthusiast Shem is on a distinguished road Shem's Avatar
    Join Date
    Mar 2008
    Posts
    303
    Rep Power
    3

    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

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Enthusiast Shem is on a distinguished road Shem's Avatar
    Join Date
    Mar 2008
    Posts
    303
    Rep Power
    3

    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

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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.
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  5. #5
    Barn Enthusiast Shem is on a distinguished road Shem's Avatar
    Join Date
    Mar 2008
    Posts
    303
    Rep Power
    3

    another question, can i add more functionality IE links, buttons to
    the gridview, or is it better to use the repeater control?

  6. #6
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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)
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO