in

CodeSmith Community

Your Code. Your Way. Faster!

Couldn't get EntityGridView to display Total Records and Records Per Page.

Last post 12-27-2006 4:20 PM by mike123. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-21-2006 10:11 AM

    • LKNetDev
    • Not Ranked
    • Joined on 08-29-2006
    • Posts 2
    • Points 70

    Couldn't get EntityGridView to display Total Records and Records Per Page.

    I have an EntityGridView that points to a ObjectDataSource object. I can get the gird to display the query results with sorting and paging. The problems I have is it always show "Total Records: -1" even though the actually number of rows displayed is 135, and the "Record Per Page" combo box box is always empty. I know the ObjectDataSource.SelectCountMethod is called and it returned the right row count. I don't know what else to try, please help!

     Thanks.

    Filed under:
    • Post Points: 35
  • 12-27-2006 4:20 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 723
    • Points 16,775

    Re: Couldn't get EntityGridView to display Total Records and Records Per Page.

     LKNetDev,

     For EntityGridView to work against ObjectDataSource edit the EntityGridView.cs and modify the following:

            void dsc_Selected(object sender, ObjectDataSourceStatusEventArgs e)
            {

                RecordsCount = e.AffectedRows;
                RecordsCount = ((DataSet)e.ReturnValue).Tables[0].Rows.Count;
            }

    Thanks,
    Michael

    P.S - You could get quicker responses to your questions from the dedicated to .nettiers forums http://community.codesmithtools.com/forums/default.aspx?GroupID=11

     

    LKNetDev:

    I have an EntityGridView that points to a ObjectDataSource object. I can get the gird to display the query results with sorting and paging. The problems I have is it always show "Total Records: -1" even though the actually number of rows displayed is 135, and the "Record Per Page" combo box box is always empty. I know the ObjectDataSource.SelectCountMethod is called and it returned the right row count. I don't know what else to try, please help!

     Thanks.

    Mike Shatny
    -------------------------------------
    Member of the .netTiers team
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
Page 1 of 1 (2 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems