We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Saving new cell value

Hello, I am having a following problem... I am able to change a value in GGC a field, but when I move a cursor the field is redrawn and old value is displayed. I try to handle the saving of a new value with TableModel.SaveCellInfo, but its handler is not called. As an alternative, I also tried CurrentRecordContextChange, which seems to work, but the Record object still have an old property value in the DataSource. Could you please advise why myGGC.TableModel.SaveCellInfo event handler is not being called and how to save the new cell value. This is somewhat similar to one I have had before with TableModel.QueryCellInfo not being called...(I should have called QueryCellStyleInfo instead) Thanks.

10 Replies

AD Administrator Syncfusion Team June 1, 2005 02:56 PM

Instead of grid.TableModel.SaveCellInfo, try using either grid.SaveCellText or grid.SaveCellFormattedText.


IK Igor Kashtelyan June 1, 2005 03:41 PM

Sorry Clay, the havendler it''s not being called either. This is what I have done: Form_Load(,) { //this.grpctrlActivityList.TableModel.SaveCellInfo += new GridSaveCellInfoEventHandler(GridSaveCellInfo); this.grpctrlActivityList.SaveCellText +=new GridCellTextEventHandler(grpctrlActivityList_SaveCellText); } private void grpctrlActivityList_SaveCellText(object sender, GridCellTextEventArgs e) { int nRowIdx = this.grpctrlActivityList.TableControl.CurrentCell.RowIndex; int nColIdx = this.grpctrlActivityList.TableControl.CurrentCell.ColIndex; //move the change back to data source: if(nColIdx == this.grpctrlActivityList.TableDescriptor.NameToField("Hours") && nRowIdx>0 ) this.m_UserActivities[nRowIdx-1].Hours = e.Style.CellValue.ToString(); } And this is my other handler that appears to be working, but the value in the Hours field still 0(initial value) this.grpctrlActivityList.CurrentRecordContextChange += new CurrentRecordContextChangeEventHandler(grpctrlActivityList_CurrentRecordContextChange); >Instead of grid.TableModel.SaveCellInfo, try using either grid.SaveCellText or grid.SaveCellFormattedText.


AD Administrator Syncfusion Team June 1, 2005 05:13 PM

Try the SaveCellFormattedText event. It is hit for me.


IK Igor Kashtelyan June 2, 2005 08:03 AM

Morning Clay, I got it working - thank you for your help! Actually, the SaveCellText was called (but not SaveCellInfo)... One thing I noticed is that SaveCellText is called several times, compating to SaveCellFormattedText, which is called twice when I move a cursor away from the cell. Why is it SaveCellText called multiple times and what is the reason the SaveCellFormattedText is called twice twice? Thanks. >Try the SaveCellFormattedText event. It is hit for me.


AD Administrator Syncfusion Team June 2, 2005 08:44 AM

I think this is a defect similar to http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=284.


IK Igor Kashtelyan June 2, 2005 09:52 AM

Yeh, looks like its similar... Clay, One more question. I have a summary row that automatically recalculates total of a given column. This is all in a dropdown form. When a user finishes updating the column (and the total is displayed in the summary row), the user clicks OK button to close the dropdown. On OK button click, the total in the summary should be displayed in the parent grid. How do I access the value in the summary row to assign it to the parent grid cell? Thanks. >I think this is a defect similar to http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=284.


AD Administrator Syncfusion Team June 2, 2005 10:28 AM

In version 3.2, there is a static method that simplifies this task. Given the group, the summaryrowdescriptor and the summarycolumndescriptor, string textvalue = GridEngine.GetSummaryText(group1, sumRowDesc1, sumColDesc1);


IK Igor Kashtelyan June 2, 2005 10:56 AM

Thanks, but I am running on 3.0.1.0 Any equivalent to the one you have just mentioned? Thnx >In version 3.2, there is a static method that simplifies this task. Given the group, the summaryrowdescriptor and the summarycolumndescriptor, > >string textvalue = GridEngine.GetSummaryText(group1, sumRowDesc1, sumColDesc1); >


AD Administrator Syncfusion Team June 2, 2005 12:40 PM

It takes some effort in earlier versions. That is why this helper method has been added. Here is a sample that computes a weighted average summary. To to this, it has to access a neighboring summary column result. You woul dhave to do something similar. http://www.syncfusion.com/support/user/uploads/gccsummary632369725731691281.zip


IK Igor Kashtelyan June 2, 2005 12:49 PM

Thanks. >It takes some effort in earlier versions. That is why this helper method has been added. > >Here is a sample that computes a weighted average summary. To to this, it has to access a neighboring summary column result. You woul dhave to do something similar. > >http://www.syncfusion.com/support/user/uploads/gccsummary632369725731691281.zip > >

Loader.
Live Chat Icon For mobile
Up arrow icon