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.

Stopping deselection when clicking

Thread ID:

Created:

Updated:

Platform:

Replies:

75604 Jul 31,2008 02:32 PM Aug 5,2008 02:28 AM Windows Forms 1
loading
Tags: Grouping
Richard Kiernan
Asked On July 31, 2008 02:32 PM

Hi there

Can anybody tell me if you can stop highlighted rows from being deselected when you right click on the selected rows?

Thanks

Richard


Nirmal Raja [Syncfusion]
Replied On August 5, 2008 02:28 AM

Hi Richard,

Thank you for your interest in Syncfusion product.

The row selection can be done manually using an event called PrepareViewStyleInfo, which will help to manage selection on both right click and left click.
If this does not help, Please let me know which control you are using or if possible please send me a sample of yours.

Sample code:
gridGroupingControl1.TableControl.PrepareViewStyleInfo += new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(TableControl_PrepareViewStyleInfo);

void TableControl_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = gridGroupingControl1.TableControl.CurrentCell;
GridControlBase grid = this.gridGroupingControl1.TableControl.CurrentCell.Grid;
if (e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount
&& cc.HasCurrentCellAt(e.RowIndex))
{
e.Style.Interior = new BrushInfo(SystemColors.Highlight);
e.Style.TextColor = SystemColors.HighlightText;
e.Style.Font.Bold = true;
}
}

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.

;