This is a migrated thread and some comments may be shown as answers.

Enter key blocks cell editing

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
chillfire
Top achievements
Rank 1
chillfire asked on 30 Jun 2014, 02:13 PM
Hi,

I have a bound GridView with calculated row totals, when we edit a cell and mouse click out the cell saves and total calculation works fine.
When we edit a cell and 'enter' out the total is calculated but the grid becomes sort of read only.
I say sort of because the only key that any cell will accept is the space key, letters/numbers are being blocked.

The code behind I am using to fire the row total update is here, the actual viewModel is simply do a linqesque query across some of the columns (this works fine).
I had to add boolean called refresh into the mix because otherwise when I called Rebind() inside the CellEditEnded it went into a infinite loop, so refresh just forces the rebind to happen once each edit.

private void dgDisplay_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
{
    refresh = true;
    _viewModel.UpdateAllowedDisplayunits();
             
    this.dgProducts.Rebind();
    dgProducts.IsEnabled = true;
}

private void dgProducts_SelectedCellsChanged(object sender, Telerik.Windows.Controls.GridView.GridViewSelectedCellsChangedEventArgs e)
{
    refresh = false;          
}


This all works if you click out of the edited cell, but as soon as you hit the enter key it blocks key inputs to the grid cell, except for the space key which it allows?

Any ideas would be gratefully accepted

craig

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Jul 2014, 09:01 AM
Hello Craig,

Generally, you should not invoke a Rebind as you finish editing a cell. Why is this needed in your case?

I have attached my test solution. Would you please extend it to demonstrate the original issue you experience?

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
chillfire
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or