Hi,
There is a bug in the sorting feature of the grid. Grid displays the incorrect data in the following scenario:
1. Sort a column (int type) by clicking the column header.
2. Enter a value in the cell in the sorted column such that the column is no longer sorted.
3. Sort the column again.
You can see the entered value appearing twice in the grid.
How to resolve this issue. Please provide the solution.
Thanks,
Amiya
AD
Administrator
Syncfusion Team
March 21, 2007 10:17 PM UTC
Hi Amiya,
You can handle CurrentCellMoved event and ending the edit on the binder forces the cached value to be cleared and makes the undo ''stick.''. Maybe something like this will work for you.
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
if(this.gridDataBoundGrid1.Binder.IsEditing)
this.gridDataBoundGrid1.Binder.EndEdit();
}
Best regards,
Haneef
AD
Administrator
Syncfusion Team
March 21, 2007 11:07 PM UTC
Hi Haneef,
Its updating the wrong row. Please help.
Thanks,
Amiya
AD
Administrator
Syncfusion Team
March 22, 2007 10:32 PM UTC
Hi Amiya,
Before calling the Binder.EndEdit mehod, you need to call the CurrentCell.EndEdit method in the CurrentCellMoving event. Please try this and let me know if this helps.
[c#]
this.grid.CurrentCell.EndEdit(); //saves the currentcell
this.grid.Binder.EndEdit(); //removes the pencil
Best regards,
Haneef
AD
Administrator
Syncfusion Team
March 23, 2007 01:38 PM UTC
Haneef,
Even this does not work. Anyways, I figured out a way to do it by updating the datasource in currentcellvalidating event handler.
Thanks,
Amiya
AM
Amiya
March 30, 2007 02:32 AM UTC
Haneef,
An update on this. Updating the datasource and binding to grid again in currentcellvalidating event works only if the user edits the cell and press the return key to end the edit. If he click on any other cell to end the editing of the current cell then the above solution doesn't work.
I'm surprised over this behavior 'coz ultimately by clicking on any other cell or pressing the return key you are ending the edit!
How do I resolve this problem?
Thanks,
Amiya