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.
Syncfusion Feedback

CurrentCell Selected Text Color

Thread ID:

Created:

Updated:

Platform:

Replies:

114344 Nov 13,2013 11:32 PM UTC Nov 21,2013 05:51 AM UTC Windows Forms 3
loading
Tags: GridControl
Ben Guy
Asked On November 13, 2013 11:32 PM UTC

I am having trouble setting the color for selected text in the CurrentCell of the GridDataBoundGrid.

I have the foreground color for the CurrentCell set to Color.White and the background color set to Color.DodgerBlue. I also have set the CurrentCell to select all the text when you click it as follows:
grid.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;

These settings works but the selected text is highlighted with a blue color that is so similar to Color.DodgerBlue that you can't tell the difference.

I would like to change the selected text color to provide more contrast. Please could you let me know how to do that?

Ben Guy
Replied On November 14, 2013 03:29 PM UTC

As well as setting the background color for text selected in the text box I also need to change the text box cursor style to make it more distinct. At the moment, the cursor position is very hard to see in the field.

Please see attached zip file containing pictures that show the selected text background color and cursor appearance problems.


problems_845e9a26.zip

Athiram S [Syncfusion]
Replied On November 21, 2013 05:41 AM UTC

Hi Ben,

The simplest way is to derive the grid, and override OnSetCursor.

Here is a sample.

http://www.syncfusion.com/support/user/uploads/7343.zip

You can add additional checks to narrow where you set the cursor.

Please let me know if you have any concerns.

Regards,
Athiram S

Athiram S [Syncfusion]
Replied On November 21, 2013 05:51 AM UTC

Hi Ben,

I have here added a technique for changing the selection color.

The SelectionBackColor property in the TableOptions can be used to set or change the back color of a selection in the Grid.

Code:

this.GridGroupingControl1.TableOptions.SelectionBackColor = Color.Pink;

UG Link:

http://www.syncfusion.com/support/kb/547/How%20can%20I%20setchange%20BackColor%20of%20a%20Selection%20in%20GridGroupingControl

Please let me know if you have any concerns.

Regards,
Athiram 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.

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

;