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

Removing current cell selection border

Thread ID:





67867 Sep 3,2007 05:48 AM UTC Sep 3,2007 11:23 PM UTC WinForms 1
Tags: GridControl
Ben Fraser
Asked On September 3, 2007 05:48 AM UTC


In order to achieve an Excel like effect we'd like to turn off the border around the current cell whenever there is a wider selection. I've attached pictures of what I am talking about.



Ajish [Syncfusion]
Replied On September 3, 2007 11:23 PM UTC

Hi Ben,

To remove current cell selection border you need to handle ShowCurrentCellBorder property and switch it accordingly in the selection changing event.

this.gridControl1.SelectionChanging += new Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventHandler(gridControl1_SelectionChanging);

void gridControl1_SelectionChanging(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs e)
GridCurrentCell cc = gridControl1.CurrentCell;
int height = gridControl1.Selections.Ranges.ActiveRange.Height;
int width = gridControl1.Selections.Ranges.ActiveRange.Width;
if (gridControl1.Selections.Ranges.AnyRangeIntersects(cc.RangeInfo) && (height > 1 || width > 1))
this.gridControl1.Model.Options.ShowCurrentCellBorderBehavior = Syncfusion.Windows.Forms.Grid.GridShowCurrentCellBorder.HideAlways;
this.gridControl1.Model.Options.ShowCurrentCellBorderBehavior = Syncfusion.Windows.Forms.Grid.GridShowCurrentCellBorder.AlwaysVisible;

Here is the link for the sample:

Kindly take a look and let me know if you need any further assistance.



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