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.
Unfortunately, activation email could not send to your email. Please try again.

Left/Right arrow keys not saving cell value, only UP/Down key does

Thread ID:

Created:

Updated:

Platform:

Replies:

53476 Dec 14,2006 01:41 AM Dec 21,2006 01:37 AM Windows Forms 5
loading
Tags: Grouping
James Blibo
Asked On December 14, 2006 01:41 AM

entering value in the ggc and pressing the left or right arrow key does not save data, only up/down arrow key works. Cell value revert back to original.

I have this code that I saw in this forum, but it's still not working.

void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if (e.Action == CurrentRecordAction.CurrentFieldChanged)
{
this.gridGroupingControl1.CurrencyManager.EndCurrentEdit();
this.gridGroupingControl1.Table.InvalidateSummary();
}
}

Administrator [Syncfusion]
Replied On December 14, 2006 04:50 AM

Hi James,

Thank you for being patience.

In your code snippet (grid Settings), we could see the use of TableControlCurrentCellKeyDown event which may be the cause of this issue. Please upload us the code snippet on this event, so we could suggest you a better solution
>>>>>>>>>>>
// FIX - > Enable LEFT/RIGHT arrow movement across caption row
this.gridGroupingControl1.TableControlCurrentCellKeyDown += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventHandler(this.gridGroupingControl1_TableControlCurrentCellKeyDown);
>>>>>>>>>>>

Note: For grid settings code snippet, refer to the following forum thread
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=53189

Best regards,
Madhan

James Blibo
Replied On December 15, 2006 11:59 AM

private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = cc.Renderer.CurrentStyle as GridTableCellStyleInfo;
if (style != null)
{
if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell)
{
e.TableControl.ForceCurrentCellMoveTo = true;

switch (e.Inner.KeyData)
{
case Keys.Right:
cc.MoveTo(cc.RowIndex, cc.ColIndex + 1, GridSetCurrentCellOptions.SetFocus);
e.Inner.Handled = true;
break;
case Keys.Left:
cc.MoveTo(cc.RowIndex, cc.ColIndex - 1, GridSetCurrentCellOptions.SetFocus);
e.Inner.Handled = true;
break;
}
}
}



}

Administrator [Syncfusion]
Replied On December 18, 2006 04:58 AM

Hi James,

The reason for the value not being updated is because of the CurrentRecordContextChange event in your code snippet. In the event, the call to EndCurrentEdit method cancels the cell value being saved to the datasource on Left / Right key down.

The following code snippet helps to update the summary row value on record value being changed.
>>>>>>>>>>>>>>>
// CurrentRecordContextChange
if (e.Action == CurrentRecordAction.EndEditComplete)
{
e.Record.InvalidateCounterBottomUp();
this.gridGroupingControl1.Refresh();
}
>>>>>>>>>>>>>>>

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

James Blibo
Replied On December 20, 2006 07:53 PM

The problem is still not solve!

When I entered a value into the cell and press the LEFT or RIGHT arrow key, your solution is now correctly accepting the result (previously the cell was reverting back to its original value). However, my custom summary rows arfe not updating except I navigate to the next row using the UP/DOWN arrow key.

The UP/DOWN arrow key works perfect. When I enter a value into the cell and use the UP/DOWN arrow key to go to the next cell, the previous cell accepts the value and the summary updates immediately. It's only the LEFT/RIGHT arrow ket that I am having problem with.


What I am trying to do is to have the cell and summary values update IMMEDIATELY when i navigate to the next cell either using the UP/DOWN or LEFT/RIGHT arrow key.

I would also like to use the LEFT/RIGHT key to go across the Caption cell.

My ggc has a flat datasource thast is grouped my one field.

Administrator [Syncfusion]
Replied On December 21, 2006 01:37 AM

Hi James,

Thanks for your response. The GridGroupingControl is designed to save the updated record to dataset, when the user moves to any other record and accordingly the summary gets recalculated.

Please try the following code snippet to update the summary value, when the current field value is changed.

>>>>>>>>>>>>>>>>>>>Code Snippet 1<<<<<<<<<<<<<<<<<<<<<<
void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if (e.Action == CurrentRecordAction.CurrentFieldChanged )
{
e.Record.InvalidateCounterBottomUp();
e.Table.SummariesDirty = true;
this.gridGroupingControl1.Refresh();
}
}
>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<

Kindly let us know if you need any further assistance.

Best regards,
Madhan

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.

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.

;