The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.