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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Saving new cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

29719 Jun 1,2005 06:39 PM UTC Jun 2,2005 05:49 PM UTC WinForms 10
loading
Tags: GridControl
Igor Kashtelyan
Asked On June 1, 2005 06:39 PM UTC

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.

Administrator [Syncfusion]
Replied On June 1, 2005 07:56 PM UTC

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

Igor Kashtelyan
Replied On June 1, 2005 08:41 PM UTC

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.

Administrator [Syncfusion]
Replied On June 1, 2005 10:13 PM UTC

Try the SaveCellFormattedText event. It is hit for me.

Igor Kashtelyan
Replied On June 2, 2005 01:03 PM UTC

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.

Administrator [Syncfusion]
Replied On June 2, 2005 01:44 PM UTC

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

Igor Kashtelyan
Replied On June 2, 2005 02:52 PM UTC

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.

Administrator [Syncfusion]
Replied On June 2, 2005 03:28 PM UTC

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);

Igor Kashtelyan
Replied On June 2, 2005 03:56 PM UTC

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); >

Administrator [Syncfusion]
Replied On June 2, 2005 05:40 PM UTC

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

Igor Kashtelyan
Replied On June 2, 2005 05:49 PM UTC

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 > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;