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

Hitting enter in last column

i have a grid that is being updated by the users. My issue is that when i only have 1 row and they hit enter after changing the data in last column, it doesn''t commit like in the other cells. I understand that it doesn''t have any where to go but i want it to commit the data and fire the SaveCellInfo. thanks, ak

11 Replies

AD Administrator Syncfusion Team August 16, 2005 03:10 PM UTC

I do not see a problem with SaveCellInfo not being hit in either a GridControl or a GridDataBoundGrid. In a GridDataBoundGrid, i do see the binder not ending its edit (leaving the pencil in teh row header). If you want to force it to end its edit at that point, you can handle the QueryNextCurrentCellPosition and handle it there. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/ImageCellGDBG_CS_2e215227.zip


AK Adam K. August 16, 2005 03:42 PM UTC

I see the SaveCellinfo working but in the second grid at the bottom even though this.gridDataBoundGrid1.Binder.EndEdit(); is being called, the cell is still in edit model and the cursor is still in the cell . . i would like it to act like the other cells when you hit enter . . -ak >I do not see a problem with SaveCellInfo not being hit in either a GridControl or a GridDataBoundGrid. > >In a GridDataBoundGrid, i do see the binder not ending its edit (leaving the pencil in teh row header). If you want to force it to end its edit at that point, you can handle the QueryNextCurrentCellPosition and handle it there. Here is a little sample. > >http://www.syncfusion.com/Support/user/uploads/ImageCellGDBG_CS_2e215227.zip >


AD Administrator Syncfusion Team August 16, 2005 04:53 PM UTC

Try this code if youdo not want to see the cursor. private void gridDataBoundGrid1_QueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e) { if(e.ColIndex == this.gridDataBoundGrid1.Model.ColCount + 1 && this.gridDataBoundGrid1.Binder.IsEditing) { int row = this.gridDataBoundGrid1.CurrentCell.RowIndex; int col = this.gridDataBoundGrid1.CurrentCell.ColIndex; this.gridDataBoundGrid1.CurrentCell.Deactivate(false);; this.gridDataBoundGrid1.CurrentCell.MoveTo(row, col); } }


AK Adam K. November 28, 2005 12:27 PM UTC

i found an instance where this doesn''t seem to work. I have a virtual grid and 1 row of data and 1 column of data and the only column is called "MyDate" i enter in the text "3Y". The savecellinfo fires and in my model code i convert this to a datetime which represents 3 years from today. The QueryNextCurrentCellPosition does fire and i do use the code below but the cell stays on "3Y" as opposed to showing the actual date. When i add a second column after hitting enter the cell moves to the right (like excel) and this cell correctly displays the actual date. Any ideas of how to get this to show the QueryCellInfo value in this cell. Should i call refresh range in the QueryNextCurrentCellPosition callback ?? thks, ak >Try this code if youdo not want to see the cursor. > >private void gridDataBoundGrid1_QueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e) >{ > if(e.ColIndex == this.gridDataBoundGrid1.Model.ColCount + 1 > && this.gridDataBoundGrid1.Binder.IsEditing) > { > int row = this.gridDataBoundGrid1.CurrentCell.RowIndex; > int col = this.gridDataBoundGrid1.CurrentCell.ColIndex; > this.gridDataBoundGrid1.CurrentCell.Deactivate(false);; > this.gridDataBoundGrid1.CurrentCell.MoveTo(row, col); > } >} >


AD Administrator Syncfusion Team November 28, 2005 02:23 PM UTC

You can try calling grid.CurrentCell.EndEdit() in this case. You can try in the QueryNextCurrentCell, of if that does not work properly, look for another event that might be raised in this case, maybe grid.CurrentCellMovedFailed is hit and can serve as a place to end the edit in this case.


AK Adam K. November 29, 2005 02:00 AM UTC

calling it the event callback doesn''t seem to do anything. Currentcellmovefailed does not seem to fire for me. any other events that would make sense ?? thks, ak >You can try calling grid.CurrentCell.EndEdit() in this case. You can try in the QueryNextCurrentCell, of if that does not work properly, look for another event that might be raised in this case, maybe grid.CurrentCellMovedFailed is hit and can serve as a place to end the edit in this case.


AD Administrator Syncfusion Team November 29, 2005 08:33 AM UTC

You say your QueryNextCurrentCell code is being hit in this case, correct? You can try to use different code at that point. Maybe calling grid.CurrentCell.EndEdit and/or grid.Binder.EndEdit would make things work. If you can upload a little sample showing what you are doing, we can try to work through the problem here.


AK Adam K. December 9, 2005 11:28 PM UTC

i dont see a grid.Binder property .. i am using 3.0.1.0 thks, ak >You say your QueryNextCurrentCell code is being hit in this case, correct? You can try to use different code at that point. Maybe calling grid.CurrentCell.EndEdit and/or grid.Binder.EndEdit would make things work. > >If you can upload a little sample showing what you are doing, we can try to work through the problem here.


AD Administrator Syncfusion Team December 10, 2005 12:24 AM UTC

You mentioned it in the 3rd post above. It is a member of GridDataBoundGrid. Is this a GridDataBoundGrid you are now referring to? It is not a member of GridControl.


AK Adam K. December 10, 2005 04:58 PM UTC

i am still using a gridcontrol in virtual grid mode. any other events to listen to fix this ? thks, ak >You mentioned it in the 3rd post above. It is a member of GridDataBoundGrid. Is this a GridDataBoundGrid you are now referring to? It is not a member of GridControl.


AD Administrator Syncfusion Team December 10, 2005 05:19 PM UTC

I don''t have any other ideas. If you can upload a sample project showing the problem, we can try to debug it here.

Loader.
Live Chat Icon For mobile
Up arrow icon