Sorting GridView

Last post 04-24-2008 12:25 AM by thiru2080. 5 replies.

Sort Posts:

  • Sorting GridView

    04-21-2008, 6:03 AM
    • Loading...
    • thiru2080
    • Joined on 04-21-2008, 5:53 AM
    • Posts 3

    Hi there,

    While i try to sort the data display in the gridview by clicking any of its column name Im getting the following error:-

     

    Server Error in '/TimeTracker' Application.
    --------------------------------------------------------------------------------

    The data source 'TimeEntryData' 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 'TimeEntryData' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet. 

    Error occuring page name : - Report_Resources_Result.aspx

    GridView Name : -  ListUserTimeEntries

    Pls ,let me know how to get ride of this error.

    Thanks In Advance.

     

    Regards,

    thiru.

     

    Filed under:
  • Re: Sorting GridView

    04-21-2008, 6:56 AM

    What are you using as a data source?

    Best regards,
    Denis Chiochiu

    ---------------------------------
    If you found this useful, please mark it as an answer. Thank you.
  • Re: Sorting GridView

    04-21-2008, 11:26 PM

    You have to handle sorting manually

    Here is Tips for sorting and other related to Gridview (See Tip: 8)

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=107&AspxAutoDetectCookieSupport=1

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: Sorting GridView

    04-22-2008, 5:46 AM
    • Loading...
    • thiru2080
    • Joined on 04-21-2008, 5:53 AM
    • Posts 3

    Im using sql 2005 database.

    My problem in not in doing sorting or paging in datagrid or with gridview in general but particularly in Microsoft sample TimeTracker application.

    Im facing the sorting issue with gridview in the time tracker application what microsoft has provided,I cant able to play with the coding wat they did.

    Inside  gridView_Sorting event the gridView objec itself becomes null, cant able to assign datasource to it.

    They hav used ObjectDataSource as the datasource ,cant able to create dataview object out of that as we need dataview object to do sorting.Like this issue list goes on........

    Hopefully some of u come across with the same sort of issue in TimeTracker applications while sorting any gridview control by clicking the column name as microsoft fail to consider the sorting option in all the gridview they used.

    Just let me know wat u hav did when u came across the same sort of issue.

  • Re: Sorting GridView

    04-22-2008, 11:26 PM

    May be In Time Tracker Application automatic sorting is not supported

    That why I provided link to you

    Have you seen that link, configure GridView event according to it

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: Sorting GridView

    04-24-2008, 12:25 AM
    • Loading...
    • thiru2080
    • Joined on 04-21-2008, 5:53 AM
    • Posts 3

    U r correct ,TimeTracker application is not supporting automatic sorting  .

    But it doesnt seems that much easy to provide sorting option from our side.

    Real problem is when ever i try to sort the grid using the event grid_sorting ,the grid object itself goes null.

    If grid object goes null, i dont know how its sort event got fired. Like this some pathetic errors are happening.

    I too know sorting a grid is not big issue but in this application its sounds tedious,by taking MS approach of creating this project in to consideration.

    Pls help me out.

Page 1 of 1 (6 items)