how to change selected row display

Aug 26, 2009 at 8:15 AM
Edited Aug 26, 2009 at 10:55 AM

Hi,

How to change the selected row display with text in white color and background as navy blue color?

On checking the source code, it seems there is DecoratorSelection class with Draw ovveride method. But not sure how to make the changes to get the desired effect.

I need to implement this for generic SourceGrid.Grid control

Thanks,
Niren.

 

Aug 26, 2009 at 11:25 AM
Hi Niren,
 
One of the examples show you how to set all of the colour options. Look at Sample 17, it is really simple.
 
Derek

On Wed, Aug 26, 2009 at 4:27 AM, niren <notifications@codeplex.com> wrote:

From: niren

Hi,

How to change the selected row display with text in white color and background as navy blue color?

On checking the source code, it seems there is DecoratorSelection class with Draw ovveride method. But not sure how to make the changes to get the desired effect.

Thanks,
Niren.

 

Read the full discussion online.

To add a post to this discussion, reply to this email (sourcegrid@discussions.codeplex.com)

To start a new discussion for this project, email sourcegrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 26, 2009 at 11:31 AM

Hi Derek,

Sample 17 only mentions how to set the backcolor as per the code below:

<font size="2">

grid1.Selection.BackColor =

</font>

Color.FromArgb(trackSelectionAlpha.Value, cPickSelBackColor.SelectedColor);

But I am not able to find, how to set the text color i.e. ForeColor for the selected cells/rows?

 Any ideas?

Thanks,
Niren.

 

Aug 26, 2009 at 11:46 AM
Sorry, I thought you could do forecolour as well. Looks like the only way would be to change the view for selected items, and set the text colour that way.
 
The Decorator is really only used for filling the cell that your data sits on.
 
Hope that helps.
Derek
Coordinator
Sep 3, 2009 at 10:05 AM

Niren, did you solve your problem?