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.
Syncfusion Feedback

Hitting enter in last column

Thread ID:

Created:

Updated:

Platform:

Replies:

33232 Aug 16,2005 02:33 PM UTC Dec 10,2005 05:19 PM UTC Windows Forms 11
loading
Tags: GridControl
Adam K.
Asked On August 16, 2005 02:33 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Adam K.
Replied On 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 >

Administrator [Syncfusion]
Replied On 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); } }

Adam K.
Replied On 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); > } >} >

Administrator [Syncfusion]
Replied On 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.

Adam K.
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

Adam K.
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

Adam K.
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

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.

Warning Icon 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.Close Icon

;