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

editing a summary cell

Hi,

I have created an editable summary cell. The summary is of type Int32Aggregate. When a user types a value into the summary cell and then hits ENTER or clicks out of the cell, I want the text in the summary cell to reflect the value that was typed into the cell. Currently the cell reverts back to the summary value. I thought about the following solutions...

1. add a hidden row in the detail section that will assume the value typed in to the cell, and then set the real detail cell values to 0.

2. temporarily turn off or supress summarizing

How would you do it?

thanks,

eric

5 Replies

EW Eric Weber September 21, 2006 12:23 AM UTC

I found this discussion, but can''t figure it out...any sample apps?

http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=18703


AD Administrator Syncfusion Team September 21, 2006 05:54 AM UTC

Hi Eric,

You can handle the QueryCellStyleInfo event to set the Style property of the summary cell to make as a editable cell. See the below code snippet for more details.

if(e.TableCellIdentity.TableCellType==GridTableCellType.SummaryEmptyCell || e.TableCellIdentity.TableCellType==GridTableCellType.SummaryFieldCell)
{

e.Style.CellType = "TextBox";
e.Style.BackColor = Color.White

//By default Enable property of summary to False.
//you need to change the Enabled property to True.
e.Style.Enabled = true;

//By default ReadOnly property of summary to True.
//you need to change the ReadOnly property to False.
e.Style.ReadOnly = false;

}

Update the summary using HashTable : http://www.syncfusion.com/Support/user/uploads/GGCSummary_420bb09d.zip

Update the summary using Last record : http://www.syncfusion.com/Support/user/uploads/LastrecUpdateSummaryNavigate_9b080d29.zip

Thanks,
Haneef


HA Harshad March 29, 2007 04:40 PM UTC

I have already done all that you have mention.. As I said I am able edit summary cell unless i click on any record cell...but when i click on the record cell after that i can not edit summary cell it throws me to the record cell earlier selected


HA haneefm Syncfusion Team March 29, 2007 06:40 PM UTC

Hi Harshad,

Try setting the CurrentRecord to null for summary cell in the TableControlCurrentCellStartEditing event of the grid. See if this helps

private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = cc.Renderer.CurrentStyle as GridTableCellStyleInfo;
Element el = style.TableCellIdentity.DisplayElement;

if( el.Kind == DisplayElementKind.Summary )
{
e.TableControl.Table.CurrentRecord = null;
}
}

Please refer to the attached sample for implementation.
GGCSummary.zip

Best regards,
Haneef


CS Central Support account / Andrew Archer June 12, 2012 12:44 PM UTC

I'd like to gain access to the sample above, as I'm facing the same issue.

Thank you.

Loader.
Live Chat Icon For mobile
Up arrow icon