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.

Removing current cell selection border

Thread ID:

Created:

Updated:

Platform:

Replies:

67867 Sep 3,2007 01:48 AM Sep 3,2007 07:23 PM Windows Forms 1
loading
Tags: GridControl
Ben Fraser
Asked On September 3, 2007 01:48 AM

Hello,

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.

Thanks,
Ben

selection.zip

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

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;
}
else
{
this.gridControl1.Model.Options.ShowCurrentCellBorderBehavior = Syncfusion.Windows.Forms.Grid.GridShowCurrentCellBorder.AlwaysVisible;
}
}
>>>>>>>

Here is the link for the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/F67867/main.htm

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

Regards,
Ajish

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.

;