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
close icon

Bug getting selected elements during SelectionChanging

I have a gridview in a control and a property control showing properties of selected rows under it. If I change the selection, I have to save the modifications. That''s why I have to get the current selection in the SelectionChanging event. Drop a GridControl on a Form, type the following code, start it and try to select multiple rows using Ctrl key. You get an exception. Imports Syncfusion.Windows.Forms.Grid Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GridControl1.ListBoxSelectionMode = SelectionMode.MultiExtended End Sub Private Sub GridControl1_SelectionChanging(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs) Handles GridControl1.SelectionChanging Dim cnt As Integer = GridControl1.Model.Selections.GetSelectedRows(True, False).Count End Sub End Class

2 Replies

AD Administrator Syncfusion Team December 2, 2005 01:25 PM UTC

I do see this problem in version 3.3, but it is not in the upcoming 4.1 release (now planned for roughly mid December). As a work-around until you have the build with this fixed, maybe you could use the GridControl1.Model.Selections.Ranges to get the ranges instead of GetSelectedRows. If you really want the rowcount, you can add up the range.Bottom - range.Top + 1 for each range in the GridControl1.Model.Selections.Ranges.


GV Gergely Varadi December 2, 2005 01:58 PM UTC

OK, thx.

Loader.
Live Chat Icon For mobile
Up arrow icon