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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Stopping deselection when clicking

Thread ID:





75604 Jul 31,2008 06:32 PM UTC Aug 5,2008 06:28 AM UTC WinForms 1
Tags: Grouping
Richard Kiernan
Asked On July 31, 2008 06:32 PM UTC

Hi there

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



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

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.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon