CodeSmith Community
Your Code. Your Way. Faster!

EntityGridView only works with DataSourceID, not a simple DataSource

Latest post 04-30-2007 3:17 PM by dwrcalgary. 3 replies.
  • 02-01-2007 11:57 AM

    • dwrcalgary
    • Top 500 Contributor
    • Joined on 08-21-2006
    • Calgary, Alberta, Canada
    • Posts 9
    • Points 195

    EntityGridView only works with DataSourceID, not a simple DataSource

    I tried using a <data:EntityGridView DataSource='<%# Eval("MyDetailsTableCollection") %>' ...

    Throws an "Object reference not set to an instance of an object."

    On line 242 in EntityGridView.cs

                DataSourceControl dsc = (DataSourceControl)this.Parent.FindControl(string.Format("{0}", this.DataSourceID));
                System.Reflection.EventInfo eventInfo = dsc.GetType().GetEvent("Selected");

    I noticed that since this.DataSourceID is null... resulting in dsc is null...
    Causes the next line of code "dsc.GetType()" to throw the exception.

    Filed under: ,
    • Post Points: 35
  • 02-05-2007 7:08 PM In reply to

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

    Re: EntityGridView only works with DataSourceID, not a simple DataSource

    dwrcalgary,

    Thanks for the report. It has been fixed (rev. 473).

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 04-30-2007 1:06 PM In reply to

    • basolutions
    • Top 100 Contributor
    • Joined on 03-21-2007
    • Denver, CO
    • Posts 51
    • Points 1,175

    Re: EntityGridView only works with DataSourceID, not a simple DataSource

    This doesn't look like its fixed.  I get errors in 2 different places if I don't use a datasourceid with my entitygrid:

    1. Line 369: OnSorting - The GridView 'EntityGridView1' fired event Sorting which wasn't handled.

            protected override void OnSorting(GridViewSortEventArgs e)
            {
                if (AllowMultiColumnSorting)
                    e.SortExpression = GetSortBLOCKED EXPRESSION;

                base.OnSorting(e);
            }

    2.  The error reported above is still giving the same error.  If it was fixed, somehow it got reverted.

    Thanks,

    Jesse

    Filed under:
    • Post Points: 35
  • 04-30-2007 3:17 PM In reply to

    • dwrcalgary
    • Top 500 Contributor
    • Joined on 08-21-2006
    • Calgary, Alberta, Canada
    • Posts 9
    • Points 195

    Re: EntityGridView only works with DataSourceID, not a simple DataSource

    Yah the next day they reverted the changes... not sure why.

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems