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.

How can i get the selected column ranges(If Multiple seletion happend through ctrl key)

Thread ID:

Created:

Updated:

Platform:

Replies:

95484 Jul 13,2010 01:49 AM Jul 21,2010 01:15 AM Windows Forms 1
loading
Tags: GridControl
BoopathiRaja
Asked On July 13, 2010 01:49 AM

Hi Friends,

I am trying to get selection rages of column. Actually i tried with the Selection Changed event handler. If column selection happened through mouse then it is giving selected range as correct for mine requirement. suppose i have selected multiple column by using ctrl key then Selection Changed event not giving whole range information. Selection Changed event giving only currently clicked column range information.

For example,

Assume that control having 5 columns(C1,C2..C5).Initially i select the C1 then i select C2 by pressing ctrl key. In this situation, Selection Changed event handler gives Finally clicked column ranges details only (C2) not C1. Suppose if multiple selection was happend through the mouse move means Selection Changed event handler gives all the selected column range information (C1:C2).

Mine Requirement is, How can i get Selected Column Ranges when selection happened by preesing ctrl key?

With Regards,
Boopathiraja.


Nirmal Raja [Syncfusion]
Replied On July 21, 2010 01:15 AM

Hi Boopathiraja,

Thank you for your interest in Syncfusion products.

Retrieving the selected range using the e.Range in the SelectionChanged event will produce only the active range of the grid, and it will not provide the whole list of selection range. When you select it through dragging then it will be a single range and when you select it through mouse click then it will take each column in to the selected range as a list. To retrieve the selected range list please get the range directly from the grid object instead of e.Range in the event.

Please refer the code below which illustrate to retrieve the selected range list:
void Model_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
Console.WriteLine(gridControl2.Selections.Ranges.ToString());
}


Let me know if you have any queries.

Regards,
Nirmal

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.

;