C1GridView and EntityDataSource

Posted by: kaytea on 10 September 2017, 11:41 am EST

  • Posted 10 September 2017, 11:41 am EST


    I have C1GridView bound to an ASP.Net EntityDataSource with Update enabled. I have the following code for the update:


    protected void gvC1Items_RowUpdating(object sender, C1GridViewUpdateEventArgs e)
    // update the datasource
    // Reset the edit mode for the current item
    gvC1Items.EditIndex = -1;

    //// Refresh the grid

    private void UpdateItemGrid()
    if (gvC1Items.EditIndex != -1)


    protected void drawEditingSymbol(int rowIndex)
    Image img = new Image();
    img.ImageUrl = "../img/editing.gif";
    gvC1Items.Rows[rowIndex].Cells[0].HorizontalAlign = HorizontalAlign.Center;

    However, i got an error at
    . Error is "invalid Datasource". How do I accomplish updating with an EntityDataSource? Appreciate your help.
  • Replied 10 September 2017, 11:41 am EST

    Well, I manually updated it through the object context, called SaveChanges(), and that worked. I guess I can't avoid the extra code. I was hoping the EntityDS would take care of changes automatically.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels