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.

SelectionChanging Event and CurrentCell.MoveTo()

Thread ID:

Created:

Updated:

Platform:

Replies:

8057 Oct 17,2003 12:29 PM Oct 20,2003 10:25 AM Windows Forms 3
loading
Tags: GridControl
Charlies Chan
Asked On October 17, 2003 12:29 PM

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.

Administrator [Syncfusion]
Replied On October 17, 2003 05: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.

Charlies Chan
Replied On October 20, 2003 09: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? Thank you.

Administrator [Syncfusion]
Replied On October 20, 2003 10: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. grid.Focus(); grid.CurrentCell.MoveTo(lastRow, someCol); grid.Selections.Clear(); grid.Selections.Add(GridRangeInfo.Row(lastRow));

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.

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.

;