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.

Bug getting selected elements during SelectionChanging

Thread ID:

Created:

Updated:

Platform:

Replies:

37924 Dec 2,2005 02:48 AM Dec 2,2005 08:58 AM Windows Forms 2
loading
Tags: GridControl
Gergely Varadi
Asked On December 2, 2005 02:48 AM

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

Administrator [Syncfusion]
Replied On December 2, 2005 08:25 AM

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.

Gergely Varadi
Replied On December 2, 2005 08:58 AM

OK, thx.

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.

;