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

Selected cell back color, how to make it look like the selected row?

Thread ID:

Created:

Updated:

Platform:

Replies:

76192 Aug 26,2008 02:55 PM UTC Sep 9,2008 05:20 AM UTC Windows Forms 5
loading
Tags: GridControl
Philippe Marseille
Asked On August 26, 2008 02:55 PM UTC

I have a GridDataBoundGrid.

Listbox Selection Mode is set to "One".

I want the selected row to have a border, like it has now, but I also want it to have the same color as the selected row. In the screenshot attached, the selected row is BLUE, but the current cell is WHITE.

How can I make the current cell blue, like the rest of the line?


Thanks!



picklist_5f0520c1.zip

SubhaSheela R [Syncfusion]
Replied On August 28, 2008 05:17 AM UTC

Hi Philippe,

Thanks for your interest in Syncfusion products.

You can change the back and text of the selected row by handling PrepareViewStyleInfo event of the GridDataBoundGrid Control.

Below is the code snippet:


private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{

if (this.gridDataBoundGrid1.Selections.Ranges.AnyRangeContains(GridRangeInfo.Cell(e.RowIndex, e.ColIndex)))
{
if (e.RowIndex != 0 && e.ColIndex != 0)
{
e.Style.BackColor = Color.Blue;
e.Style.TextColor = Color.Cyan;
}
}
}


Please let me know if it helps.

Regards,
Subhasheela R



Philippe Marseille
Replied On September 2, 2008 01:04 PM UTC

Alright, that worked to change the color of the selected row. What I want is to have the selected CELL not to be white.

I'm using "listviewselectmode = One". The grid puts an alpha blending on the selected row, but not on the selected cell. It stays white.

How can I do that? (have the AlphaBlending on the selected cell?)


SubhaSheela R [Syncfusion]
Replied On September 5, 2008 04:34 AM UTC


Hi Philippe,

Thanks for your update.

You can select the entire row in same color wherever you click by setting the code snippet that I have sent previously.

Here is the sample that illustrates the same:

GDBGSelectedRowBackColor.zip

You can also refer the browser sample available in below path that discusses the same:

\\MyDocuments\Syncfusion\EssentialStudio\6.3.0.25\Windows\Grid.Windows\Samples\2.0\DynamicFormatting\HighlightCurrentRow\cs

Please let me know with more details if this does not serve your need.

Regards,
Subhasheela R


Philippe Marseille
Replied On September 5, 2008 04:31 PM UTC

Yes, that was exactly what I was looking for.

Thank you ;)


SubhaSheela R [Syncfusion]
Replied On September 9, 2008 05:20 AM UTC


Hi Philippe,

Thanks for your update.

Please feel free to open a new one if you need any other technical concern.

Regards,
Subhasheela R


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

;