Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
How to have only one line selected using BindingSource.MoveNext/Previous?
posted

I'm having problems with UltraGrid again.

Let's say we have a form with an UltraGrid on it. The grid is databound to a generic BindingList. User is by design not able to edit/add/delete. User can select only one row at time (no multiselect).

The grid is accompanied by "Move Next" and "Move Previous" buttons.. I want to be able to change the currently selected row.

I thought I could acheive this using BindingSource.MoveNext and MovePrevious methods. Partially. The selection changes indeed. Unfortunately, the previously selected item (using either mouse click or keyboard) stays selected (visually).

Similar behaviour can be observed when a user clicks a row, holds the LMB, and moves the cursor over any other row. When the LMB is released UltraGrid shows that 2 rows are selected, instead of only one.

WindowsFormsApplication1.zip
Parents Reply Children