I have the grid in 'FullRowSelect' mode. So the row is selected as a whole. But the active cell is still highlighted in a different color. How do I disable that? I just want the entire row to be highlighted without the current cell being highlighted in a different color.
Thanks,
Vithiya
Thanks,
Vithiya
5 Answers, 1 is accepted
0
Hi Vithiya,
Thank you for contacting us.
In FullRowSelect mode the current cell is still highlighted because the grid has a different background style for the current cell in its theme. You can remove this style or you use CellFormatting event to disable background painting:
Hope this helps. Let me know if you have any additional questions.
Greetings,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thank you for contacting us.
In FullRowSelect mode the current cell is still highlighted because the grid has a different background style for the current cell in its theme. You can remove this style or you use CellFormatting event to disable background painting:
void
radGridView1_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement.IsCurrent)
{
e.CellElement.DrawFill =
false
;
}
}
Hope this helps. Let me know if you have any additional questions.
Greetings,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Jason Richmeier
Top achievements
Rank 1
answered on 04 Oct 2010, 10:10 PM
I have been trying to determine a solution for this issue as well.
The code sample provided in the previous post does not appear to do anything (the cell is still highlighted). It sounds as though there is an alternate approach. Can you provide details on this approach?
The code sample provided in the previous post does not appear to do anything (the cell is still highlighted). It sounds as though there is an alternate approach. Can you provide details on this approach?
0

Emanuel Varga
Top achievements
Rank 1
answered on 05 Oct 2010, 06:44 AM
Hello guys,
If you just want to disable OnHover you can just set:
If you have any more question, please do not hesitate.
Update, sorry i don't know how i got the idea that you just wanted to disable onhover...
But if you want to change the selection styles, or any other styles for that matter you should use VisualStyleBuilder(http://www.telerik.com/help/winforms/vsb_gettingstarted.html), there you can define whichever color styles you want.
Or you could just try:
This way the current cell won't have that border, but it looks strange in my point of view...
Best Regards,
Emanuel Varga
If you just want to disable OnHover you can just set:
radGridView1.EnableHotTracking =
false
;
If you have any more question, please do not hesitate.
Update, sorry i don't know how i got the idea that you just wanted to disable onhover...
But if you want to change the selection styles, or any other styles for that matter you should use VisualStyleBuilder(http://www.telerik.com/help/winforms/vsb_gettingstarted.html), there you can define whichever color styles you want.
Or you could just try:
void
radGridView1_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement.IsCurrent)
{
e.CellElement.IsCurrent =
false
;
}
}
This way the current cell won't have that border, but it looks strange in my point of view...
Best Regards,
Emanuel Varga
0

Jason Richmeier
Top achievements
Rank 1
answered on 05 Oct 2010, 02:39 PM
I cannot speak for the original poster but I know in my case, I do not need to distinguish which cell is selected in the row but rather that an entire row is selected. I could see highlighting the selected row being desired if the grid allowed in-place edits. In my case, however, the grid data is read only.
I found that instead of the code...
e.CellElement.IsCurrent = false;
...the following code works more the way I want...
I found that instead of the code...
e.CellElement.IsCurrent = false;
...the following code works more the way I want...
e.CellElement.DrawBorder = false;
e.CellElement.DrawFill = false;
0
Hello Jason Richmeier,
The described solution will work, however we recommend resetting the values when the cell does not meet the conditions:
This should be done due to reusing of cell elements by the RadGridView.
If you have any further questions, please do not hesitate to ask.
Greetings, Svett
the Telerik team
The described solution will work, however we recommend resetting the values when the cell does not meet the conditions:
void
radGridView1_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement.IsCurrent)
{
e.CellElement.DrawFill =
false
;
e.CellElement.DrawBorder =
false
;
}
else
{
e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, Telerik.WinControls.ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local);
}
}
This should be done due to reusing of cell elements by the RadGridView.
If you have any further questions, please do not hesitate to ask.
Greetings, Svett
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items