Hi, I am using GridDataBoundGrid. The dataGrid's Model.SelectionChanging event is tied to a method that tries to verify if the existing data has been updated to prompt the user to save.
When a new item is inserted to the grid, a new row is added and I use the CurrentCell.MoveTo() to highlight the new row. In certain cases, even though the CurrentCell.RowIndex is shown to be updated, the highlight is not. Also, the SelectionChanging event doesn't even fire as it should be.
I would like to know mainly what needs to be done to make sure the selection to update. I also have a CurrentCellActivating handler. The CurrentCellActivating handler does fire everytime...
Thanks for the assistance.
ADAdministrator Syncfusion Team October 17, 2003 04:22 PM
SelectionsChanging is a event that fires where the user drags the mouse to select cells. Is this the action you want to catch to verify data?
Maybe you need to use either the CurrentCellValidating or the CurrentCellMoving events. These events fire when the user makes a change and then tries to leave the current cell, or when the user just tries to move the current cell respectively.
CCCharlies ChanOctober 20, 2003 08:45 AM
Thanks for your help Clay.
Unfortunately, I think I might not have been clear with my question. Let me try to rephase it again.
Basically, I have a GDBG. I add an item to the end of the list. I then call CurrentCell.MoveTo() to move the focus last item in the list. The last item in this list is highlighted.
Now I click on another item in the list (e.g. 3rd item). I click Add again, another item is being inserted into the list. Again, CurrentCell.MoveTo() is called inside the same function. Now when I check CurrentCell.RowIndex, it gives me the correct/last row in the list. Yet this row is somehow not highlighted. The highlight is still at the 3rd row I selected previously. If I now click on the last row, the highlight will follow.
How can I make MoveTo() highlight the last row?
ADAdministrator Syncfusion Team October 20, 2003 09:25 AM
Make sure the grid has focus when you try this. Also you can try explicitly selecting the lastrow after your call to MoveTo.