The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Inserting a record in a GridView ?

Last post 10-30-2007, 5:06 AM by Scott.Schecter. 2 replies.
Sort Posts: Previous Next
  •  10-20-2007, 2:12 PM 5953

    Inserting a record in a GridView ?

    I know this is a newbie question, but  I'm just getting started with the  esDataSource  and can't figure out where the "Insert" occurs?

     My code is basically a clone of your forum example:  I'm using Sql 2000 so  paging / sorting are turned off

    I've wired the  esCreateEntity and esSelect  (also esPostSelect),,,grid is filling, editing works, but how do i  "Insert" a new record?

       It doesnt look like your using the  "ShowInsertButton"  in your sample code?  So how does:

           e.PrimaryKeys == Nothing get a hit?

    Im referring to your sample code as in:

    protected void esDataSrc_esCreateEntity(object sender, esDataSourceCreateEntityEventArgs e)
    {
        Employees entity = new Employees();

        if (e.PrimaryKeys == null)
            entity.AddNew();
        else
       
        entity.LoadByPrimaryKey((int)e.PrimaryKeys[0]);

        // Assign the Entity
        e.Entity = entity;
    }

     

    Thanks for all the great work you guys have done...

  •  10-29-2007, 6:39 PM 6163 in reply to 5953

    Re: Inserting a record in a GridView ?

    We will provide this in our next beta release.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  10-30-2007, 5:06 AM 6172 in reply to 6163

    Re: Inserting a record in a GridView ?

    The problem is there is no AutoGenerate Insert button for the GridView.

    Public property AutoGenerateDeleteButton Gets or sets a value indicating whether a CommandField field column with a Delete button for each data row is automatically added to a GridView control.
    Public property AutoGenerateEditButton Gets or sets a value indicating whether a CommandField field column with an Edit button for each data row is automatically added to a GridView control.
    Public property AutoGenerateSelectButton Gets or sets a value indicating whether a CommandField field column with a Select button for each data row is automatically added to a GridView control.

     


    Regards,

    Scott Schecter
    EntitySpaces | My Site
View as RSS news feed in XML