Declined
Last Updated: 14 Jul 2015 13:50 by ADMIN
ADMIN
Angel Petrov
Created on: 19 Jun 2014 10:41
Category: Grid
Type: Bug Report
0
If a DataKeyName is set for a detail table and .Rebind() is called in the OnUpdateCommand event handler an exception is thrown.

		
1 comment
ADMIN
Radoslav
Posted on: 14 Jul 2015 13:50
This is a limitation into the grid control. Rebind() method cannot be called in UpdateCommand event handler. A workaround in this case will be to call .Rebind() conditionally in PreRender event:
bool shouldRebind = false;
    protected void rgReservation_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        shouldRebind = true;
    }

    void rgReservation_PreRender(object sender, EventArgs e)
    {
        if (shouldRebind)
        {
            rgReservation.DataSource = null;
            rgReservation.Rebind();
        }
    }