GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

Update and Delete not updating the grid visually

Last post 02-25-2010, 5:51 AM by Amit Pal. 9 replies.
Sort Posts: Previous Next
  •  01-28-2010, 12:34 PM 86932

    Update and Delete not updating the grid visually

    Hi guys,

    When the user clicks Update or Delete, I have code that handles the delete or update in the database.  The code is being run fine, and the data is being updated.  However, the screen isn't being updated.  When the user deletes rows, the rows aren't removed from the screen. Also when they update, I have code that updates related cells in that same row that's not being updated.

    I have my spread control in an UpdatePanel.  I have a feeling that the UpdatePanel may be causing the Spread control to get lost when the data is updated in the control.  Is there anything you can suggest?

     --Rob

  •  01-29-2010, 8:41 AM 86950 in reply to 86932

    Re: Update and Delete not updating the grid visually

    Hi Rob, I think the issue should be resolved by setting the 'EnableAjaxCall" property to FALSE (since you already having an UpdatePanel). If the issue persists, please attach a small sample project replicating the problem.

    Thanks,

    ~Jacob

  •  01-29-2010, 6:40 PM 86979 in reply to 86950

    Re: Update and Delete not updating the grid visually

    Thanks Jacob,

    I have EnableAjaxCall set to false.  I also have ClientAutoCalculation set to false and EnableClientScript set to true.

    My project file contains proprietary information, so I'll need to clear that before I can post anything.  If anyone else has had this issue, I'd greatly appreciate any suggestions.  I have a feeling I may just have a setting wrong.

    --Rob

  •  02-01-2010, 9:41 AM 87008 in reply to 86979

    Re: Update and Delete not updating the grid visually

    Rob,

     

    We will wait for the sample application from your side.

    It seems to me that the changes are not being made to the Data Model of the Spread and this could be the reason why Spread is not showing the updated data. Please check if you are calling SaveChanges() to save the changes to the Spread component.

     


    Amit Pal
    Grapecity-Farpoint
  •  02-01-2010, 2:54 PM 87017 in reply to 87008

    Re: Update and Delete not updating the grid visually

    Hi Amit,

    I wasn't calling the SaveChanges() method.  I'm getting a Javascript error now on my Delete command. 

    The .NET code is:

    protected void fpsDataEntry_DeleteCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
    {
        DRPService.
    sessionInfo mySession = (DRPService.sessionInfo)Session["SessionInfo"];
        DRPService.
    DRPServiceClient client = new DRPService.DRPServiceClient();

        int intItemID = 0;

        // Note: There are 2 iterations because the user is allowed to 
        // select non-consecutive rows to delete
        // the first iteration is for collections of rows
        // the second iteration is the rows within a collection
        for (int intCollection = fpsDataEntry.ActiveSheetView.SelectionModel.Count - 1; intCollection >= 0; intCollection--)
            {
                int index = fpsDataEntry.ActiveSheetView.SelectionModel[intCollection].Row;
                int count = fpsDataEntry.ActiveSheetView.SelectionModel[intCollection].RowCount;
                int intHighestRow = index + count - 1;

                for (int intRows = intHighestRow; intRows >= index; intRows--) 
                    {
                        intItemID =
    Convert.ToInt32(fpsDataEntry.ActiveSheetView.GetDataKey(intRows).ToString());

                        if (intItemID < 1000000) //Anything above ID 1000000 is a placeholder for an empty row

                            {
                                client.UpdateItemStatus(mySession, intItemID, 5);
    //mark item with deleted status
                            }
                    }

            fpsDataEntry.ActiveSheetView.RemoveRows(index, count);

        }

        e.Handled = true;
        fpsDataEntry.SaveChanges();

    }

    The Javascript Error is:

    Sys.ArgumentNullException: Value cannot be null.
    Parameter name: array

    Did I place the fpsDataEntry.SaveChanges() call in the right place?  Also I'm using an UpdatePanel...it's looking like maybe Javascript can't find the spread control on the page within the panel.

    --Rob

  •  02-02-2010, 8:10 AM 87035 in reply to 87017

    Re: Update and Delete not updating the grid visually

    Hello,

     

    Yes, you did place the SaveChanges() method at the right place and that should work.

    Is this error being thrown client side or server side?

    Can  you please attach a running sample application?

     


    Amit Pal
    Grapecity-Farpoint
  •  02-02-2010, 1:53 PM 87047 in reply to 87035

    Re: Update and Delete not updating the grid visually

    The error is being thrown on the client side.  The call makes it to the server, and the server process it, but then the client throws a javascript error on return.

    I'm trying to get you a sample application, but it's taking me time to get things stripped out.  The Spread Control interacts with a database, and I have no clue how to get you a working sample.  In addition I have proprietary information in the code that i need to remove before I send it.

    Thanks,
    Rob

  •  02-03-2010, 2:30 PM 87081 in reply to 87047

    Re: Update and Delete not updating the grid visually

    Hello,

    If possible can you provide me a sample which shows similar behavior and works on any sample database like NWind. Your sample will help me to diagnose the cause further.

    Regards,
    Ankit Nigam

  •  02-25-2010, 12:18 AM 87557 in reply to 87081

    Re: Update and Delete not updating the grid visually

    Hi guys,

    For some reason, when I use the Render method to hide buttons, I get the above JavaScript error.  I took that out, and everything works.  I add it in, then it quits working. 

    I'll be looking into it more later this week, and will update this post if I find a good solution.

    Thanks!
    Rob

  •  02-25-2010, 5:51 AM 87573 in reply to 87557

    Re: Update and Delete not updating the grid visually

    Hello,

     

    I have gone through the entire thread once again however could not find any reason for this. If possible, can you please attach a sample application along with a test database and the steps to reproduce this issue. If this not a possibility then can you please attach the code in the Render method and I will take a look into it.


    Amit Pal
    Grapecity-Farpoint
View as RSS news feed in XML
     FarPoint Forums Home