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.

Cancel Selection on Grid Grouping Control

Thread ID:

Created:

Updated:

Platform:

Replies:

92599 Jan 25,2010 04:09 AM Feb 2,2010 06:44 AM Windows Forms 5
loading
Tags: GridControl
Ruslan Gasanbekov
Asked On January 25, 2010 04:09 AM

Hi,

I am using grid grouping control.
When the user select a record on the grid, the values of the record are transferred to the related controls.
On second select if the user changed the previous record, I want to cancel the new selection means:
The new record that the user select won't be selected and the previous record will stay selected.
I am using the CurrentRecordContextChanged event.

See the attached file.

How can I do it?

Thanks




gridGruoping_573f86c3.rar

Lingaraj S [Syncfusion]
Replied On January 26, 2010 04:31 AM

Hi Ruslan,

Thank you for your interest in Syncfusion products.

If you want to prevent the selection in GridGroupingControl, then please try using Cancel property in SelectionChanging event to

achieve your requirement.

this.gridGroupingControl1.SelectedRecordsChanging += new

SelectedRecordsChangedEventHandler(gridGroupingControl1_SelectedRecordsChanging);
void gridGroupingControl1_SelectedRecordsChanging(object sender, SelectedRecordsChangedEventArgs e)
{
// try using your conditional statements here
{
e.Cancel = true;
}
}


Please let me know if you have any queries.

Regards,
Lingaraj S.

Ruslan Gasanbekov
Replied On January 26, 2010 07:44 AM

Hi,

I tried to do it,but it doesn't work.

After canceling this event, the cursor on the listbox is moved to the new selected record (which is the current record), and the old selected record is marked (see attachment).

Cancling this event only prevent the SelectedRecordChanged event to occour.

Is there any other way to cancel the user selection?





example_87fd35ba.rar

Lingaraj S [Syncfusion]
Replied On January 27, 2010 07:26 AM

Hi Ruslan,

Thank you for the update.

Please try using Cancel property in CurrentRecordContextChange when LeaveRecordCalled action called in GridGroupingControl as shown below.

void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
switch (e.Action)
{
//other codes
case Syncfusion.Grouping.CurrentRecordAction.LeaveRecordCalled:
{
// Try using you conditional statements
{
e.Cancel = true;
}
}
break;
}
}


Please let me know if you have any queries.

Regards,
Lingaraj S.

Ruslan Gasanbekov
Replied On February 1, 2010 05:06 AM

Hi,

I tried to cancel only the LeaveRecordCalled action but it doesn't work - it doesn't cancel the selection of the new row.

Do you have a nother solution.

Thanks.

Lingaraj S [Syncfusion]
Replied On February 2, 2010 06:44 AM

Hi Ruslan,

Thank you for the update.

Please try using CurrentRecordContextChange and SelectionChanging events in GridGroupingControl to achieve your requirement. Because SelectionChanging event is used to prevent the selection in GridGroupingControl and CurrentRecordContextChange is used to prevent the current record move in GridGroupingControl.

Please let me know if you have any queries.

Regards,
Lingaraj S.

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.

;